aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-12-03 10:17:39 +0100
committerEinar Johan Trøan Sømåen2012-12-03 10:17:39 +0100
commit7071acfa478a39b492643530f9f4927cd4e85e51 (patch)
treea37d3914ff513eb674910a4c847b526cf370179d /engines
parent3b581a3b68f6fbff288c4114c1199433fa71b44d (diff)
downloadscummvm-rg350-7071acfa478a39b492643530f9f4927cd4e85e51.tar.gz
scummvm-rg350-7071acfa478a39b492643530f9f4927cd4e85e51.tar.bz2
scummvm-rg350-7071acfa478a39b492643530f9f4927cd4e85e51.zip
WINTERMUTE: Privatize members in BaseKeyboardState
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/base/base_game.cpp2
-rw-r--r--engines/wintermute/base/base_keyboard_state.cpp5
-rw-r--r--engines/wintermute/base/base_keyboard_state.h17
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