1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

SDL: Use scancodes for keybindings (#14964)

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
This commit is contained in:
y5nw 2025-03-16 20:35:34 +01:00 committed by GitHub
parent e0378737b7
commit cc65c8bd70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 509 additions and 369 deletions

View file

@ -147,12 +147,13 @@ bool GUIModalMenu::remapClickOutside(const SEvent &event)
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP &&
current.isRelated(last)) {
SEvent translated{};
translated.EventType = EET_KEY_INPUT_EVENT;
translated.KeyInput.Key = KEY_ESCAPE;
translated.KeyInput.Control = false;
translated.KeyInput.Shift = false;
translated.KeyInput.PressedDown = true;
translated.KeyInput.Char = 0;
translated.EventType = EET_KEY_INPUT_EVENT;
translated.KeyInput.Key = KEY_ESCAPE;
translated.KeyInput.SystemKeyCode = EscapeKey.getScancode();
translated.KeyInput.Control = false;
translated.KeyInput.Shift = false;
translated.KeyInput.PressedDown = true;
translated.KeyInput.Char = 0;
OnEvent(translated);
return true;
}