aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-06-22 23:43:17 +0000
committerMax Horn2007-06-22 23:43:17 +0000
commit05a70fc8e404bd2003e8faa3bc1d4564918eca03 (patch)
tree27db3513094a4453f614b4fe125ff5a78f58e53a
parentd9718b068446add78e62c92f104e1ad6243d19ef (diff)
downloadscummvm-rg350-05a70fc8e404bd2003e8faa3bc1d4564918eca03.tar.gz
scummvm-rg350-05a70fc8e404bd2003e8faa3bc1d4564918eca03.tar.bz2
scummvm-rg350-05a70fc8e404bd2003e8faa3bc1d4564918eca03.zip
Produce 'correct' keycode/ascii values for function keys
svn-id: r27642
-rw-r--r--backends/platform/PalmOS/Src/base_event.cpp13
-rw-r--r--backends/platform/PalmOS/Src/zodiac_event.cpp2
-rw-r--r--backends/platform/ds/arm9/source/dsmain.cpp2
-rw-r--r--backends/platform/gp32/gp32_osys.cpp4
4 files changed, 13 insertions, 8 deletions
diff --git a/backends/platform/PalmOS/Src/base_event.cpp b/backends/platform/PalmOS/Src/base_event.cpp
index 620195deeb..a3913529b6 100644
--- a/backends/platform/PalmOS/Src/base_event.cpp
+++ b/backends/platform/PalmOS/Src/base_event.cpp
@@ -262,14 +262,14 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) {
case vchrLaunch:
event.type = Common::EVENT_KEYDOWN;
event.kbd.keycode = Common::KEYCODE_ESCAPE;
- event.kbd.ascii = Common::KEYCODE_ESCAPE;
+ event.kbd.ascii = Common::ASCII_ESCAPE;
event.kbd.flags = 0;
return true;
// F5 = menu
case vchrMenu:
event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = Common::ASCII_F5; // FIXME: Should be changed to KEYCODE_F5
+ event.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = Common::ASCII_F5;
event.kbd.flags = 0;
return true;
@@ -411,8 +411,13 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) {
// F1 -> F10 key
if (key >= '0' && key <= '9' && mask == (Common::KBD_CTRL|Common::KBD_ALT)) {
- key = (key == '0') ? 324 : (Common::ASCII_F1 + key - '1');
- mask = 0;
+ key = (key - '0' + 10 - 1) % 10; // '0' -> 9, '1' -> 0, '2' -> 1, ...
+ _wasKey = true;
+ event.type = Common::EVENT_KEYDOWN;
+ event.kbd.keycode = Common::KEYCODE_F1 + key;
+ event.kbd.ascii = Common::ASCII_F1 + key;
+ event.kbd.flags = 0;
+ return true;
#ifdef STDLIB_TRACE_MEMORY
// print memory
diff --git a/backends/platform/PalmOS/Src/zodiac_event.cpp b/backends/platform/PalmOS/Src/zodiac_event.cpp
index 3ee2a32654..84ecc27097 100644
--- a/backends/platform/PalmOS/Src/zodiac_event.cpp
+++ b/backends/platform/PalmOS/Src/zodiac_event.cpp
@@ -46,7 +46,7 @@ bool OSystem_PalmZodiac::check_event(Common::Event &event, EventPtr ev) {
// F5 = menu
case vchrThumbWheelBack:
event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = Common::ASCII_F5; // FIXME: Should be KEYCODE_F5
+ event.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = Common::ASCII_F5;
event.kbd.flags = 0;
return true;
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp
index be5d0a14a2..af5addac66 100644
--- a/backends/platform/ds/arm9/source/dsmain.cpp
+++ b/backends/platform/ds/arm9/source/dsmain.cpp
@@ -1253,7 +1253,7 @@ void addEventsToQueue() {
if ((getKeysChanged() & KEY_START)) {
event.type = getKeyEvent(KEY_START);
- event.kbd.keycode = Common::ASCII_F5; // FIXME: Should be KEYCODE_F5
+ event.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = Common::ASCII_F5;
event.kbd.flags = 0;
system->addEvent(event);
diff --git a/backends/platform/gp32/gp32_osys.cpp b/backends/platform/gp32/gp32_osys.cpp
index 1f07b0660d..f6e0a10bbc 100644
--- a/backends/platform/gp32/gp32_osys.cpp
+++ b/backends/platform/gp32/gp32_osys.cpp
@@ -529,7 +529,7 @@ bool OSystem_GP32::pollEvent(Common::Event &event) {
if (_overlayVisible)
event.kbd.keycode = event.kbd.ascii = 13;
else {
- event.kbd.keycode = Common::ASCII_F5; // FIXME: Should be KEYCODE_F5
+ event.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = Common::ASCII_F5;
}
return true;
@@ -603,7 +603,7 @@ bool OSystem_GP32::pollEvent(Common::Event &event) {
if (_overlayVisible)
event.kbd.keycode = event.kbd.ascii = 13;
else {
- event.kbd.keycode = Common::ASCII_F5; // FIXME: Should be KEYCODE_F5
+ event.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = Common::ASCII_F5;
}
return true;