diff options
author | Willem Jan Palenstijn | 2015-07-22 22:37:40 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-07-22 22:43:42 +0200 |
commit | 6ec9c81b575f13b2c4b30aeac592ebf2557b5890 (patch) | |
tree | 503d50902bad2d800165593039d08d5ccf0c98ab /engines/wintermute/base/base_keyboard_state.cpp | |
parent | 5ec05f6b647c5ea41418be7ed19ad381f97cabd8 (diff) | |
parent | 4e5c8d35f7e133e2e72a846fdbd54900c91eeb73 (diff) | |
download | scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.gz scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.bz2 scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.zip |
Merge branch 'master' into mm
Conflicts:
engines/access/access.cpp
engines/access/asurface.h
engines/access/bubble_box.cpp
engines/access/bubble_box.h
engines/access/martian/martian_game.cpp
engines/access/player.cpp
engines/access/player.h
engines/access/resources.cpp
engines/access/screen.cpp
engines/access/screen.h
engines/access/sound.cpp
engines/access/sound.h
Diffstat (limited to 'engines/wintermute/base/base_keyboard_state.cpp')
-rw-r--r-- | engines/wintermute/base/base_keyboard_state.cpp | 101 |
1 files changed, 76 insertions, 25 deletions
diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp index 0babc07586..f672c83d39 100644 --- a/engines/wintermute/base/base_keyboard_state.cpp +++ b/engines/wintermute/base/base_keyboard_state.cpp @@ -262,41 +262,92 @@ bool BaseKeyboardState::isCurrentPrintable() const { } ////////////////////////////////////////////////////////////////////////// +enum VKeyCodes { + kVkReturn = 13, + + kVkEscape = 27, + + kVkSpace = 32, + kVkEnd = 35, + kVkHome = 36, + kVkLeft = 37, + kVkUp = 38, + kVkRight = 39, + kVkDown = 40, + + kVkF1 = 112, + kVkF2 = 113, + kVkF3 = 114, + kVkF4 = 115, + kVkF5 = 116, + kVkF6 = 117, + kVkF7 = 118, + kVkF8 = 119, + kVkF9 = 120, + kVkF10 = 121, + kVkF11 = 122, + kVkF12 = 123 + +}; + +////////////////////////////////////////////////////////////////////////// uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) { + // todo if (event->type != Common::EVENT_KEYDOWN) { return 0; } switch (event->kbd.keycode) { + case Common::KEYCODE_RETURN: case Common::KEYCODE_KP_ENTER: - return Common::KEYCODE_RETURN; + return kVkReturn; + case Common::KEYCODE_ESCAPE: + return kVkEscape; + case Common::KEYCODE_SPACE: + return kVkSpace; + case Common::KEYCODE_END: + return kVkEnd; + case Common::KEYCODE_HOME: + return kVkHome; + case Common::KEYCODE_LEFT: + return kVkLeft; + case Common::KEYCODE_RIGHT: + return kVkRight; + case Common::KEYCODE_UP: + return kVkUp; + case Common::KEYCODE_DOWN: + return kVkDown; + case Common::KEYCODE_F1: + return kVkF1; + case Common::KEYCODE_F2: + return kVkF2; + case Common::KEYCODE_F3: + return kVkF3; + case Common::KEYCODE_F4: + return kVkF4; + case Common::KEYCODE_F5: + return kVkF5; + case Common::KEYCODE_F6: + return kVkF6; + case Common::KEYCODE_F7: + return kVkF7; + case Common::KEYCODE_F8: + return kVkF8; + case Common::KEYCODE_F9: + return kVkF9; + case Common::KEYCODE_F10: + return kVkF10; + case Common::KEYCODE_F11: + return kVkF11; + case Common::KEYCODE_F12: + return kVkF12; default: - return (uint32)event->kbd.ascii; + warning("Key not handled: %d '%c'", event->kbd.keycode, event->kbd.keycode); + return event->kbd.keycode; + break; } -} -enum VKeyCodes { - kVkEscape = 27, - kVkSpace = 32, - kVkHome = 36, - kVkLeft = 37, - kVkUp = 38, - kVkRight = 39, - kVkDown = 40, - - kVkF1 = 112, - kVkF2 = 113, - kVkF3 = 114, - kVkF4 = 115, - kVkF5 = 116, - kVkF6 = 117, - kVkF7 = 118, - kVkF8 = 119, - kVkF9 = 120, - kVkF10 = 121, - kVkF11 = 122, - kVkF12 = 123 -}; +} ////////////////////////////////////////////////////////////////////////// Common::KeyCode BaseKeyboardState::vKeyToKeyCode(uint32 vkey) { |