protected override bool OnPreKeyEvent(CefBrowser browser, CefKeyEvent keyEvent, IntPtr os_event, out bool isKeyboardShortcut) { if (keyEvent.EventType == CefKeyEventType.RawKeyDown) webBrowser.OnPreviewKeyDown(keyEvent.Modifiers == CefEventFlags.AltDown, keyEvent.Modifiers == CefEventFlags.ControlDown, keyEvent.Modifiers == CefEventFlags.ShiftDown, keyEvent.FocusOnEditableField, keyEvent.WindowsKeyCode, keyEvent.Character); return base.OnPreKeyEvent(browser, keyEvent, os_event, out isKeyboardShortcut); }
private int on_key_event(cef_keyboard_handler_t *self, cef_browser_t *browser, cef_key_event_t * @event, IntPtr os_event) { CheckSelf(self); var m_browser = CefBrowser.FromNative(browser); var m_event = CefKeyEvent.FromNative(@event); // TODO: wrap cef_event_handle_t (os_event) IntPtr m_os_event = IntPtr.Zero; if (os_event != IntPtr.Zero) { } var result = OnKeyEvent(m_browser, m_event, m_os_event); return(result ? 1 : 0); }
/// <summary> /// Send a key event to the browser. /// </summary> public void SendKeyEvent(CefKeyEvent keyEvent) { if (keyEvent == null) throw new ArgumentNullException("keyEvent"); var n_event = new cef_key_event_t(); keyEvent.ToNative(&n_event); cef_browser_host_t.send_key_event(_self, &n_event); }
/// <summary> /// Called after the renderer and JavaScript in the page has had a chance to /// handle the event. |event| contains information about the keyboard event. /// |os_event| is the operating system event message, if any. Return true if /// the keyboard event was handled or false otherwise. /// </summary> protected virtual bool OnKeyEvent(CefBrowser browser, CefKeyEvent keyEvent, IntPtr osEvent) { return false; }
/// <summary> /// Called before a keyboard event is sent to the renderer. |event| contains /// information about the keyboard event. |os_event| is the operating system /// event message, if any. Return true if the event was handled or false /// otherwise. If the event will be handled in OnKeyEvent() as a keyboard /// shortcut set |is_keyboard_shortcut| to true and return false. /// </summary> protected virtual bool OnPreKeyEvent(CefBrowser browser, CefKeyEvent keyEvent, IntPtr os_event, out bool isKeyboardShortcut) { isKeyboardShortcut = false; return false; }
/// <summary> /// Called after the renderer and JavaScript in the page has had a chance to /// handle the event. |event| contains information about the keyboard event. /// |os_event| is the operating system event message, if any. Return true if /// the keyboard event was handled or false otherwise. /// </summary> protected virtual bool OnKeyEvent(CefBrowser browser, CefKeyEvent keyEvent, IntPtr osEvent) { return(false); }
/// <summary> /// Called before a keyboard event is sent to the renderer. |event| contains /// information about the keyboard event. |os_event| is the operating system /// event message, if any. Return true if the event was handled or false /// otherwise. If the event will be handled in OnKeyEvent() as a keyboard /// shortcut set |is_keyboard_shortcut| to true and return false. /// </summary> protected virtual bool OnPreKeyEvent(CefBrowser browser, CefKeyEvent keyEvent, IntPtr os_event, out bool isKeyboardShortcut) { isKeyboardShortcut = false; return(false); }
/// <summary> /// Send a key event to the browser. /// </summary> public void SendKeyEvent(CefKeyEvent keyEvent) { if (keyEvent == null) throw new ArgumentNullException("keyEvent"); }