From 05a70fc8e404bd2003e8faa3bc1d4564918eca03 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 22 Jun 2007 23:43:17 +0000 Subject: Produce 'correct' keycode/ascii values for function keys svn-id: r27642 --- backends/platform/PalmOS/Src/base_event.cpp | 13 +++++++++---- backends/platform/PalmOS/Src/zodiac_event.cpp | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'backends/platform/PalmOS') 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; -- cgit v1.2.3