MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / HandleToolbarHotkey

Function HandleToolbarHotkey

src/window.cpp:2636–2646  ·  view source on GitHub ↗

* Handle Toolbar hotkey events - can come from a source like the MacBook Touch Bar. * @param hotkey Hotkey code */

Source from the content-addressed store, hash-verified

2634 * @param hotkey Hotkey code
2635 */
2636void HandleToolbarHotkey(int hotkey)
2637{
2638 assert(HasModalProgress() || IsLocalCompany());
2639
2640 Window *w = FindWindowById(WC_MAIN_TOOLBAR, 0);
2641 if (w != nullptr) {
2642 if (w->window_desc.hotkeys != nullptr) {
2643 if (hotkey >= 0 && w->OnHotkey(hotkey) == ES_HANDLED) return;
2644 }
2645 }
2646}
2647
2648/**
2649 * Handle keyboard input.

Callers

nothing calls this directly

Calls 4

HasModalProgressFunction · 0.85
IsLocalCompanyFunction · 0.85
FindWindowByIdFunction · 0.85
OnHotkeyMethod · 0.45

Tested by

no test coverage detected