diff options
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp index 407288511..d07b597e4 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2587,6 +2587,22 @@ EventState Window::HandleEditBoxKey(int wid, WChar key, uint16 keycode) } /** + * Handle Toolbar hotkey events - can come from a source like the MacBook Touch Bar. + * @param hotkey Hotkey code + */ +void HandleToolbarHotkey(int hotkey) +{ + assert(HasModalProgress() || IsLocalCompany()); + + Window *w = FindWindowById(WC_MAIN_TOOLBAR, 0); + if (w != nullptr) { + if (w->window_desc->hotkeys != nullptr) { + if (hotkey >= 0 && w->OnHotkey(hotkey) == ES_HANDLED) return; + } + } +} + +/** * Handle keyboard input. * @param keycode Virtual keycode of the key. * @param key Unicode character of the key. |