mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 09:37:03 +00:00
1d2fb9531f
Required for arrow/tab key presses to be forwarded correctly to DevTools Only required when CefSettings.MultiThreadedMessageLoop = false
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
// Copyright © 2019 The CefSharp Authors. All rights reserved.
|
|
//
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
|
|
using System.Windows.Forms;
|
|
|
|
namespace CefSharp.WinForms.Example
|
|
{
|
|
public class DevToolsContainerControl : Control
|
|
{
|
|
protected override bool IsInputKey(Keys keyData)
|
|
{
|
|
//This code block is only called/required when CEF is running in the
|
|
//same message loop as the WinForms UI (CefSettings.MultiThreadedMessageLoop = false)
|
|
//Without this code, arrows and tab won't be processed
|
|
switch (keyData)
|
|
{
|
|
case Keys.Right:
|
|
case Keys.Left:
|
|
case Keys.Up:
|
|
case Keys.Down:
|
|
case Keys.Tab:
|
|
{
|
|
return true;
|
|
}
|
|
case Keys.Shift | Keys.Tab:
|
|
case Keys.Shift | Keys.Right:
|
|
case Keys.Shift | Keys.Left:
|
|
case Keys.Shift | Keys.Up:
|
|
case Keys.Shift | Keys.Down:
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return base.IsInputKey(keyData);
|
|
}
|
|
}
|
|
}
|