views: Add support for accelerators (issue #2102)

This commit is contained in:
Marshall Greenblatt
2017-02-16 18:19:43 -05:00
parent e4867b5afb
commit bd1b80198f
35 changed files with 948 additions and 74 deletions

View File

@@ -95,6 +95,24 @@ class CefWindowDelegate : public CefPanelDelegate {
///
/*--cef()--*/
virtual bool CanClose(CefRefPtr<CefWindow> window) { return true; }
///
// Called when a keyboard accelerator registered with
// CefWindow::SetAccelerator is triggered. Return true if the accelerator was
// handled or false otherwise.
///
/*--cef()--*/
virtual bool OnAccelerator(CefRefPtr<CefWindow> window,
int command_id) { return false; }
///
// Called after all other controls in the window have had a chance to
// handle the event. |event| contains information about the keyboard event.
// Return true if the keyboard event was handled or false otherwise.
///
/*--cef()--*/
virtual bool OnKeyEvent(CefRefPtr<CefWindow> window,
const CefKeyEvent& event) { return false; }
};
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_