1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 15:24:30 +01:00

Allow setting CMD as shortcut key

This commit is contained in:
Marijn van der Werf
2016-01-12 22:29:36 +01:00
parent d8d706cc58
commit 72739e8cd8
4 changed files with 16 additions and 0 deletions

View File

@@ -1391,6 +1391,8 @@ void title_handle_keyboard_input()
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_COPY_Z;
if (gKeysState[SDL_SCANCODE_LALT] || gKeysState[SDL_SCANCODE_RALT])
gInputPlaceObjectModifier |= 4;
if (gKeysState[SDL_SCANCODE_LGUI] || gKeysState[SDL_SCANCODE_RGUI])
gInputPlaceObjectModifier |= 8;
}
}
@@ -1451,6 +1453,9 @@ void game_handle_keyboard_input()
if (gKeysState[SDL_SCANCODE_LALT] || gKeysState[SDL_SCANCODE_RALT]) {
gInputPlaceObjectModifier |= 4;
}
if (gKeysState[SDL_SCANCODE_LGUI] || gKeysState[SDL_SCANCODE_RGUI]) {
gInputPlaceObjectModifier |= 8;
}
game_handle_key_scroll();
}
}
@@ -1634,6 +1639,7 @@ void game_handle_key_scroll()
const int SHIFT = 0x100;
const int CTRL = 0x200;
const int ALT = 0x400;
const int CMD = 0x800;
uint16 shortcutKey = gShortcutKeys[shortcutId];
uint8 scancode = shortcutKey & 0xFF;
@@ -1650,6 +1656,9 @@ void game_handle_key_scroll()
if (shortcutKey & ALT) {
if (!gKeysState[SDL_SCANCODE_LALT] && !gKeysState[SDL_SCANCODE_RALT]) continue;
}
if (shortcutKey & CMD) {
if (!gKeysState[SDL_SCANCODE_LGUI] && !gKeysState[SDL_SCANCODE_RGUI]) continue;
}
switch (shortcutId) {
case SHORTCUT_SCROLL_MAP_UP: