Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
In my initialization, I did this: this.KeyPreview = true;
Then I made invisible buttons and hung regular keystrokes on them.
Through a class like this:
public class KeyboardHandler : IKeyboardHandler
{
public bool OnPreKeyEvent(IWebBrowser chromiumWebBrowser, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey, ref bool isKeyboardShortcut)
{
if (type == KeyType.KeyUp && Enum.IsDefined(typeof(Keys), windowsKeyCode))
{
var key = (Keys)windowsKeyCode;
switch (key)
{
case Keys.F5:
browser.Reload(true);
break;
}
}
return false;
}
public bool OnKeyEvent(IWebBrowser chromiumWebBrowser, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey)
{
var result = false;
return result;
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question