diff options
Diffstat (limited to 'engines/wintermute/base/base_keyboard_state.cpp')
-rw-r--r-- | engines/wintermute/base/base_keyboard_state.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp index aeb56ad282..61087c5836 100644 --- a/engines/wintermute/base/base_keyboard_state.cpp +++ b/engines/wintermute/base/base_keyboard_state.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -221,12 +221,12 @@ bool BaseKeyboardState::persist(BasePersistenceManager *persistMgr) { //if (!persistMgr->getIsSaving()) cleanup(); BaseScriptable::persist(persistMgr); - persistMgr->transfer(TMEMBER(_currentAlt)); - persistMgr->transfer(TMEMBER(_currentCharCode)); - persistMgr->transfer(TMEMBER(_currentControl)); - persistMgr->transfer(TMEMBER(_currentKeyData)); - persistMgr->transfer(TMEMBER(_currentPrintable)); - persistMgr->transfer(TMEMBER(_currentShift)); + persistMgr->transferBool(TMEMBER(_currentAlt)); + persistMgr->transferUint32(TMEMBER(_currentCharCode)); + persistMgr->transferBool(TMEMBER(_currentControl)); + persistMgr->transferUint32(TMEMBER(_currentKeyData)); + persistMgr->transferBool(TMEMBER(_currentPrintable)); + persistMgr->transferBool(TMEMBER(_currentShift)); if (!persistMgr->getIsSaving()) { _keyStates = new uint8[323]; // Hardcoded size for the common/keyboard.h enum @@ -276,17 +276,21 @@ uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) { } enum VKeyCodes { - kVkSpace = 32, - kVkLeft = 37, - kVkUp = 38, - kVkRight = 39, - kVkDown = 40 + kVkEscape = 27, + kVkSpace = 32, + kVkLeft = 37, + kVkUp = 38, + kVkRight = 39, + kVkDown = 40 }; ////////////////////////////////////////////////////////////////////////// Common::KeyCode BaseKeyboardState::vKeyToKeyCode(uint32 vkey) { // todo switch (vkey) { + case kVkEscape: + return Common::KEYCODE_ESCAPE; + break; case kVkSpace: return Common::KEYCODE_SPACE; break; |