Feature: Add selected toolbar buttons to MacBook Pro Touch Bar

This commit is contained in:
Danny de Bruijne
2021-08-19 17:39:44 +01:00
committed by Michael Lutz
parent 16aac9c341
commit 753b1d7e15
8 changed files with 257 additions and 51 deletions

View File

@@ -2586,6 +2586,22 @@ EventState Window::HandleEditBoxKey(int wid, WChar key, uint16 keycode)
return ES_HANDLED;
}
/**
* 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.