| 55 | } |
| 56 | |
| 57 | void HookKeyboardHandler(cef_client_t *client) |
| 58 | { |
| 59 | if (!config::options::use_hotkeys()) |
| 60 | return; |
| 61 | |
| 62 | static auto GetKeyboardHandler = client->get_keyboard_handler; |
| 63 | client->get_keyboard_handler = [](cef_client_t *self) -> cef_keyboard_handler_t * |
| 64 | { |
| 65 | auto handler = GetKeyboardHandler(self); |
| 66 | |
| 67 | OnPreKeyEvent = handler->on_pre_key_event; |
| 68 | handler->on_pre_key_event = Hooked_OnPreKeyEvent; |
| 69 | |
| 70 | return handler; |
| 71 | }; |
| 72 | } |
no test coverage detected