From 63ad1c9b9b644f469a246401affbea6ee1d6d8e8 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sun, 8 Jul 2012 19:11:33 +0200 Subject: WINTERMUTE: Rename FuncName/VarName -> funcName/varName in BKeyboardState --- engines/wintermute/Base/BGame.cpp | 2 +- engines/wintermute/Base/BKeyboardState.cpp | 22 +++++++++++----------- engines/wintermute/Base/BKeyboardState.h | 12 ++++++------ engines/wintermute/UI/UIEdit.cpp | 14 +++++++------- engines/wintermute/UI/UIWindow.cpp | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp index 6b3d9fdbed..03a278476c 100644 --- a/engines/wintermute/Base/BGame.cpp +++ b/engines/wintermute/Base/BGame.cpp @@ -3791,7 +3791,7 @@ bool CBGame::handleKeypress(Common::Event *event, bool printable) { _keyboardState->handleKeyPress(event); - _keyboardState->ReadKey(event); + _keyboardState->readKey(event); // TODO if (_focusedWindow) { diff --git a/engines/wintermute/Base/BKeyboardState.cpp b/engines/wintermute/Base/BKeyboardState.cpp index 94b015f5e9..36a208b317 100644 --- a/engines/wintermute/Base/BKeyboardState.cpp +++ b/engines/wintermute/Base/BKeyboardState.cpp @@ -92,7 +92,7 @@ HRESULT CBKeyboardState::scCallMethod(CScScript *script, CScStack *stack, CScSta warning("BKeyboardState doesnt yet have state-support %d", vKey); //TODO; // Uint8 *state = SDL_GetKeyboardState(NULL); // SDL_Scancode scanCode = SDL_GetScancodeFromKey(VKeyToKeyCode(vKey)); - bool isDown = _keyStates[VKeyToKeyCode(vKey)]; + bool isDown = _keyStates[vKeyToKeyCode(vKey)]; stack->pushBool(isDown); return S_OK; @@ -195,9 +195,9 @@ const char *CBKeyboardState::scToString() { ////////////////////////////////////////////////////////////////////////// -HRESULT CBKeyboardState::ReadKey(Common::Event *event) { +HRESULT CBKeyboardState::readKey(Common::Event *event) { //_currentPrintable = (event->type == SDL_TEXTINPUT); // TODO - _currentCharCode = KeyCodeToVKey(event); + _currentCharCode = keyCodeToVKey(event); if ((_currentCharCode <= Common::KEYCODE_z && _currentCharCode >= Common::KEYCODE_a) || (_currentCharCode <= Common::KEYCODE_9 && _currentCharCode >= Common::KEYCODE_0)) { _currentPrintable = true; @@ -206,9 +206,9 @@ HRESULT CBKeyboardState::ReadKey(Common::Event *event) { } //_currentKeyData = KeyData; - _currentControl = IsControlDown(); - _currentAlt = IsAltDown(); - _currentShift = IsShiftDown(); + _currentControl = isControlDown(); + _currentAlt = isAltDown(); + _currentShift = isShiftDown(); return S_OK; } @@ -237,25 +237,25 @@ HRESULT CBKeyboardState::persist(CBPersistMgr *persistMgr) { } ////////////////////////////////////////////////////////////////////////// -bool CBKeyboardState::IsShiftDown() { +bool CBKeyboardState::isShiftDown() { int mod = g_system->getEventManager()->getModifierState(); return (mod & Common::KBD_SHIFT); } ////////////////////////////////////////////////////////////////////////// -bool CBKeyboardState::IsControlDown() { +bool CBKeyboardState::isControlDown() { int mod = g_system->getEventManager()->getModifierState(); return (mod & Common::KBD_CTRL); } ////////////////////////////////////////////////////////////////////////// -bool CBKeyboardState::IsAltDown() { +bool CBKeyboardState::isAltDown() { int mod = g_system->getEventManager()->getModifierState(); return (mod & Common::KBD_ALT); } ////////////////////////////////////////////////////////////////////////// -uint32 CBKeyboardState::KeyCodeToVKey(Common::Event *event) { +uint32 CBKeyboardState::keyCodeToVKey(Common::Event *event) { if (event->type != Common::EVENT_KEYDOWN) return 0; switch (event->kbd.keycode) { @@ -267,7 +267,7 @@ uint32 CBKeyboardState::KeyCodeToVKey(Common::Event *event) { } ////////////////////////////////////////////////////////////////////////// -Common::KeyCode CBKeyboardState::VKeyToKeyCode(uint32 vkey) { +Common::KeyCode CBKeyboardState::vKeyToKeyCode(uint32 vkey) { // todo return (Common::KeyCode)vkey; } diff --git a/engines/wintermute/Base/BKeyboardState.h b/engines/wintermute/Base/BKeyboardState.h index 982dc2998f..da324b86a3 100644 --- a/engines/wintermute/Base/BKeyboardState.h +++ b/engines/wintermute/Base/BKeyboardState.h @@ -50,13 +50,13 @@ public: DECLARE_PERSISTENT(CBKeyboardState, CBScriptable) CBKeyboardState(CBGame *inGame); virtual ~CBKeyboardState(); - HRESULT ReadKey(Common::Event *event); + HRESULT readKey(Common::Event *event); void handleKeyPress(Common::Event *event); void handleKeyRelease(Common::Event *event); - static bool IsShiftDown(); - static bool IsControlDown(); - static bool IsAltDown(); + static bool isShiftDown(); + static bool isControlDown(); + static bool isAltDown(); // scripting interface virtual CScValue *scGetProperty(const char *name); @@ -66,8 +66,8 @@ public: private: uint8 *_keyStates; - uint32 KeyCodeToVKey(Common::Event *event); - Common::KeyCode VKeyToKeyCode(uint32 vkey); //TODO, reimplement using ScummVM-backend + uint32 keyCodeToVKey(Common::Event *event); + Common::KeyCode vKeyToKeyCode(uint32 vkey); //TODO, reimplement using ScummVM-backend }; } // end of namespace WinterMute diff --git a/engines/wintermute/UI/UIEdit.cpp b/engines/wintermute/UI/UIEdit.cpp index 4bb3684b3c..39f8e993b2 100644 --- a/engines/wintermute/UI/UIEdit.cpp +++ b/engines/wintermute/UI/UIEdit.cpp @@ -698,7 +698,7 @@ bool CUIEdit::handleKeypress(Common::Event *event, bool printable) { // ctrl+A case Common::KEYCODE_a: - if (CBKeyboardState::IsControlDown()) { + if (CBKeyboardState::isControlDown()) { _selStart = 0; _selEnd = strlen(_text); Handled = true; @@ -719,24 +719,24 @@ bool CUIEdit::handleKeypress(Common::Event *event, bool printable) { case Common::KEYCODE_LEFT: case Common::KEYCODE_UP: _selEnd--; - if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd; + if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd; Handled = true; break; case Common::KEYCODE_RIGHT: case Common::KEYCODE_DOWN: _selEnd++; - if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd; + if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd; Handled = true; break; case Common::KEYCODE_HOME: if (Game->_textRTL) { _selEnd = strlen(_text); - if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd; + if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd; } else { _selEnd = 0; - if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd; + if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd; } Handled = true; break; @@ -744,10 +744,10 @@ bool CUIEdit::handleKeypress(Common::Event *event, bool printable) { case Common::KEYCODE_END: if (Game->_textRTL) { _selEnd = 0; - if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd; + if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd; } else { _selEnd = strlen(_text); - if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd; + if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd; } Handled = true; break; diff --git a/engines/wintermute/UI/UIWindow.cpp b/engines/wintermute/UI/UIWindow.cpp index b4043a0d41..9cda6072db 100644 --- a/engines/wintermute/UI/UIWindow.cpp +++ b/engines/wintermute/UI/UIWindow.cpp @@ -1103,7 +1103,7 @@ const char *CUIWindow::scToString() { bool CUIWindow::handleKeypress(Common::Event *event, bool printable) { //TODO if (event->type == Common::EVENT_KEYDOWN && event->kbd.keycode == Common::KEYCODE_TAB) { - return SUCCEEDED(moveFocus(!CBKeyboardState::IsShiftDown())); + return SUCCEEDED(moveFocus(!CBKeyboardState::isShiftDown())); } else { if (_focusedWidget) return _focusedWidget->handleKeypress(event, printable); else return false; -- cgit v1.2.3