1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +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

@@ -3971,6 +3971,7 @@ STR_5629 :Difficulty level
STR_5630 :Enable unlocking of scenarios
STR_5631 :Original DLC Parks
STR_5632 :Build your own...
STR_5633 :CMD +
#############
# Scenarios #

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:

View File

@@ -100,6 +100,10 @@ void keyboard_shortcut_format_string(char *buffer, uint16 shortcutKey)
format_string(formatBuffer, STR_ALT_PLUS, NULL);
strcat(buffer, formatBuffer);
}
if (shortcutKey & 0x800) {
format_string(formatBuffer, STR_CMD_PLUS, NULL);
strcat(buffer, formatBuffer);
}
strcat(buffer, SDL_GetScancodeName(shortcutKey & 0xFF));
}

View File

@@ -2256,6 +2256,8 @@ enum {
STR_DLC_PARKS = 5631,
STR_BUILD_YOUR_OWN_PARKS = 5632,
STR_CMD_PLUS = 5633,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768