diff options
-rw-r--r-- | engines/wintermute/base/base_game.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/base/base_keyboard_state.cpp | 5 | ||||
-rw-r--r-- | engines/wintermute/base/base_keyboard_state.h | 17 |
3 files changed, 15 insertions, 9 deletions
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index 7bdcbedb52..0d6897ce4f 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -3729,7 +3729,7 @@ bool BaseGame::handleKeypress(Common::Event *event, bool printable) { // TODO if (_focusedWindow) { - if (!_gameRef->_focusedWindow->handleKeypress(event, _keyboardState->_currentPrintable)) { + if (!_gameRef->_focusedWindow->handleKeypress(event, _keyboardState->isCurrentPrintable())) { /*if (event->type != SDL_TEXTINPUT) {*/ if (_gameRef->_focusedWindow->canHandleEvent("Keypress")) { _gameRef->_focusedWindow->applyEvent("Keypress"); diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp index da7baafd2d..e12583b5a4 100644 --- a/engines/wintermute/base/base_keyboard_state.cpp +++ b/engines/wintermute/base/base_keyboard_state.cpp @@ -258,6 +258,11 @@ bool BaseKeyboardState::isAltDown() { } ////////////////////////////////////////////////////////////////////////// +bool BaseKeyboardState::isCurrentPrintable() const { + return _currentPrintable; +} + +////////////////////////////////////////////////////////////////////////// uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) { if (event->type != Common::EVENT_KEYDOWN) { return 0; diff --git a/engines/wintermute/base/base_keyboard_state.h b/engines/wintermute/base/base_keyboard_state.h index dfd0efdec0..b62ece02b7 100644 --- a/engines/wintermute/base/base_keyboard_state.h +++ b/engines/wintermute/base/base_keyboard_state.h @@ -39,14 +39,6 @@ namespace Wintermute { class BaseKeyboardState : public BaseScriptable { public: - uint32 _currentKeyData; - uint32 _currentCharCode; - bool _currentPrintable; - - bool _currentShift; - bool _currentAlt; - bool _currentControl; - DECLARE_PERSISTENT(BaseKeyboardState, BaseScriptable) BaseKeyboardState(BaseGame *inGame); virtual ~BaseKeyboardState(); @@ -57,6 +49,7 @@ public: static bool isShiftDown(); static bool isControlDown(); static bool isAltDown(); + bool isCurrentPrintable() const; // scripting interface virtual ScValue *scGetProperty(const Common::String &name); @@ -65,6 +58,14 @@ public: virtual const char *scToString(); private: + bool _currentPrintable; + uint32 _currentKeyData; + uint32 _currentCharCode; + + bool _currentShift; + bool _currentAlt; + bool _currentControl; + uint8 *_keyStates; uint32 keyCodeToVKey(Common::Event *event); Common::KeyCode vKeyToKeyCode(uint32 vkey); //TODO, reimplement using ScummVM-backend |