aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/platform/sdl/events.cpp2
-rw-r--r--common/events.h19
2 files changed, 20 insertions, 1 deletions
diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp
index f865282876..8738e63d95 100644
--- a/backends/platform/sdl/events.cpp
+++ b/backends/platform/sdl/events.cpp
@@ -52,7 +52,7 @@
static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode)
{
if (key >= SDLK_F1 && key <= SDLK_F9) {
- return key - SDLK_F1 + 315;
+ return key - SDLK_F1 + ASCII_F1;
} else if (key >= SDLK_KP0 && key <= SDLK_KP9) {
return key - SDLK_KP0 + '0';
} else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) {
diff --git a/common/events.h b/common/events.h
index 0330f4b417..253c9f053c 100644
--- a/common/events.h
+++ b/common/events.h
@@ -217,6 +217,25 @@ enum KeyCode {
};
/**
+ * List of fake 'ascii' values used in keyboard events.
+ * The values here are based on what certain SCUMM games require
+ * in their scripts.
+ * @todo Get rid of this, and instead enforce that engines use the
+ * keycode instead to handle these.
+ */
+enum {
+ ASCII_F1 = 315,
+ ASCII_F2 = 316,
+ ASCII_F3 = 317,
+ ASCII_F4 = 318,
+ ASCII_F5 = 319,
+ ASCII_F6 = 320,
+ ASCII_F7 = 321,
+ ASCII_F8 = 322,
+ ASCII_F9 = 323
+};
+
+/**
* Keyboard modifier flags, used for Event::kbd::flags.
*/
enum {