aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Ulmer2002-05-20 21:19:53 +0000
committerLionel Ulmer2002-05-20 21:19:53 +0000
commitadf44644cce9a1ca3e4f26160b22aa5a4d4aed2e (patch)
tree75c862baf179b2a49fb5f17411034faf855281ba
parentf6b934e068f9d59a2a8b6a02b7dc27e68e02e1de (diff)
downloadscummvm-rg350-adf44644cce9a1ca3e4f26160b22aa5a4d4aed2e.tar.gz
scummvm-rg350-adf44644cce9a1ca3e4f26160b22aa5a4d4aed2e.tar.bz2
scummvm-rg350-adf44644cce9a1ca3e4f26160b22aa5a4d4aed2e.zip
Add modifier support to the X11 port.
svn-id: r4366
-rw-r--r--x11.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/x11.cpp b/x11.cpp
index b33c0c89e4..3de40c70a8 100644
--- a/x11.cpp
+++ b/x11.cpp
@@ -819,6 +819,11 @@ bool OSystem_X11::poll_event(Event *scumm_event) {
*/
int keycode = -1;
int ascii = -1;
+ byte mode = 0;
+
+ if (event.xkey.state & 0x01) mode |= KBD_SHIFT;
+ if (event.xkey.state & 0x04) mode |= KBD_CTRL;
+ if (event.xkey.state & 0x08) mode |= KBD_ALT;
switch (event.xkey.keycode) {
case 9: /* Escape on my PC */
case 130: /* Calendar on the iPAQ */
@@ -857,7 +862,7 @@ bool OSystem_X11::poll_event(Event *scumm_event) {
scumm_event->event_code = EVENT_KEYDOWN;
scumm_event->kbd.keycode = keycode;
scumm_event->kbd.ascii = (ascii != -1 ? ascii : keycode);
- scumm_event->kbd.flags = 0;
+ scumm_event->kbd.flags = mode;
return true;
}
} break;