1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-11 23:48:19 +02:00

key name capture

This commit is contained in:
Laserlicht
2025-07-19 13:09:15 +02:00
parent 6e61cb0cf3
commit 21df285e5a
10 changed files with 67 additions and 10 deletions

View File

@@ -88,6 +88,8 @@ void InputSourceKeyboard::handleEventKeyDown(const SDL_KeyboardEvent & key)
auto shortcutsVector = ENGINE->shortcuts().translateKeycode(keyName);
ENGINE->events().dispatchKeyPressed(keyName);
if (vstd::contains(shortcutsVector, EShortcut::MAIN_MENU_LOBBY))
ENGINE->user().onGlobalLobbyInterfaceActivated();
@@ -142,6 +144,8 @@ void InputSourceKeyboard::handleEventKeyUp(const SDL_KeyboardEvent & key)
assert(key.state == SDL_RELEASED);
auto shortcutsVector = ENGINE->shortcuts().translateKeycode(keyName);
ENGINE->events().dispatchKeyReleased(keyName);
ENGINE->events().dispatchShortcutReleased(shortcutsVector);
}