aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-02-24 22:48:39 +0000
committerFilippos Karapetis2009-02-24 22:48:39 +0000
commit1dff55f90132f12fbf266d83b9ccdb309f1176a5 (patch)
tree4e729c4e1c2cb754593a1b56570526f4302ebf6d
parent595c6557668e3bf8c753093b9e4ce9cac32a6928 (diff)
downloadscummvm-rg350-1dff55f90132f12fbf266d83b9ccdb309f1176a5.tar.gz
scummvm-rg350-1dff55f90132f12fbf266d83b9ccdb309f1176a5.tar.bz2
scummvm-rg350-1dff55f90132f12fbf266d83b9ccdb309f1176a5.zip
Process modifier keys (capslock, numlock, scrollock)
svn-id: r38868
-rw-r--r--engines/sci/gfx/gfx_driver.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp
index a142de162c..2967d83525 100644
--- a/engines/sci/gfx/gfx_driver.cpp
+++ b/engines/sci/gfx/gfx_driver.cpp
@@ -351,7 +351,24 @@ static sci_event_t scummvm_get_event(gfx_driver_t *drv) {
((modifiers & Common::KBD_ALT) ? SCI_EVM_ALT : 0) |
((modifiers & Common::KBD_CTRL) ? SCI_EVM_CTRL : 0) |
((modifiers & Common::KBD_SHIFT) ? SCI_EVM_LSHIFT | SCI_EVM_RSHIFT : 0);
- //TODO: SCI_EVM_SCRLOCK SCI_EVM_NUMLOCK SCI_EVM_CAPSLOCK SCI_EVM_INSERT
+
+ // We add the modifier key status to buckybits
+ // SDL sends a keydown event if a modifier key is turned on and a keyup event if it's off
+ if (ev.type == Common::EVENT_KEYDOWN) {
+ switch (ev.kbd.keycode) {
+ case Common::KEYCODE_CAPSLOCK:
+ input.buckybits |= SCI_EVM_CAPSLOCK;
+ break;
+ case Common::KEYCODE_NUMLOCK:
+ input.buckybits |= SCI_EVM_NUMLOCK;
+ break;
+ case Common::KEYCODE_SCROLLOCK:
+ input.buckybits |= SCI_EVM_SCRLOCK;
+ break;
+ }
+ }
+
+ //TODO: SCI_EVM_INSERT
switch (ev.type) {
// Keyboard events