Feature: Add selected toolbar buttons to MacBook Pro Touch Bar
This commit is contained in:

committed by
Michael Lutz

parent
16aac9c341
commit
753b1d7e15
@@ -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.
|
||||
|
Reference in New Issue
Block a user