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

@@ -103,6 +103,22 @@ typedef struct _cef_window_delegate_t {
///
int (CEF_CALLBACK *can_close)(struct _cef_window_delegate_t* self,
struct _cef_window_t* window);
///
// Called when a keyboard accelerator registered with
// cef_window_t::SetAccelerator is triggered. Return true (1) if the
// accelerator was handled or false (0) otherwise.
///
int (CEF_CALLBACK *on_accelerator)(struct _cef_window_delegate_t* self,
struct _cef_window_t* window, int command_id);
///
// 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 (1) if the keyboard event was handled or false (0) otherwise.
///
int (CEF_CALLBACK *on_key_event)(struct _cef_window_delegate_t* self,
struct _cef_window_t* window, const struct _cef_key_event_t* event);
} cef_window_delegate_t;