diff options
author | Filippos Karapetis | 2009-02-24 22:48:39 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-02-24 22:48:39 +0000 |
commit | 1dff55f90132f12fbf266d83b9ccdb309f1176a5 (patch) | |
tree | 4e729c4e1c2cb754593a1b56570526f4302ebf6d /engines/sci | |
parent | 595c6557668e3bf8c753093b9e4ce9cac32a6928 (diff) | |
download | scummvm-rg350-1dff55f90132f12fbf266d83b9ccdb309f1176a5.tar.gz scummvm-rg350-1dff55f90132f12fbf266d83b9ccdb309f1176a5.tar.bz2 scummvm-rg350-1dff55f90132f12fbf266d83b9ccdb309f1176a5.zip |
Process modifier keys (capslock, numlock, scrollock)
svn-id: r38868
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/gfx/gfx_driver.cpp | 19 |
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 |