1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00
This commit is contained in:
IntelOrca
2015-07-16 16:42:46 +01:00
parent 354d604b26
commit 48028fcfc4
6 changed files with 35 additions and 21 deletions

View File

@@ -22,6 +22,7 @@
#include "../config.h"
#include "../game.h"
#include "../input.h"
#include "../localisation/localisation.h"
#include "keyboard_shortcut.h"
#include "viewport.h"
#include "window.h"
@@ -75,6 +76,26 @@ void keyboard_shortcut_handle_command(int shortcutIndex)
shortcut_table[shortcutIndex]();
}
void keyboard_shortcut_format_string(char *buffer, uint16 shortcutKey)
{
char *formatBuffer[256];
*buffer = 0;
if (shortcutKey & 0x100) {
format_string(formatBuffer, STR_SHIFT_PLUS, NULL);
strcat(buffer, formatBuffer);
}
if (shortcutKey & 0x200) {
format_string(formatBuffer, STR_CTRL_PLUS, NULL);
strcat(buffer, formatBuffer);
}
if (shortcutKey & 0x400) {
format_string(formatBuffer, STR_ALT_PLUS, NULL);
strcat(buffer, formatBuffer);
}
strcat(buffer, SDL_GetScancodeName(shortcutKey & 0xFF));
}
#pragma region Shortcut Commands
static void toggle_view_flag(int viewportFlag)

View File

@@ -24,5 +24,6 @@
void keyboard_shortcut_set(int key);
void keyboard_shortcut_handle(int key);
void keyboard_shortcut_handle_command(int shortcutIndex);
void keyboard_shortcut_format_string(char *buffer, uint16 shortcutKey);
#endif