diff options
author | Johannes Schickel | 2010-02-17 16:18:23 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-02-17 16:18:23 +0000 |
commit | c8470e1d8915134bca7836732c174c40d3b9cf97 (patch) | |
tree | 0a7f08deb2207170ca3a8e4a1b5182cca46ddfbf /engines/kyra | |
parent | 5d6b9af72a0e40d6d48a6e064516509d6129a4ce (diff) | |
download | scummvm-rg350-c8470e1d8915134bca7836732c174c40d3b9cf97.tar.gz scummvm-rg350-c8470e1d8915134bca7836732c174c40d3b9cf97.tar.bz2 scummvm-rg350-c8470e1d8915134bca7836732c174c40d3b9cf97.zip |
Use Common::KEYCODE_* instead of ASCII values for keycode comparison.
svn-id: r48079
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/gui.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_v1.cpp | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index f5fe417c0d..d976c3463d 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -421,7 +421,7 @@ void GUI::checkTextfieldInput() { while (_vm->_eventMan->pollEvent(event) && running) { switch (event.type) { case Common::EVENT_KEYDOWN: - if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL) + if (event.kbd.keycode == Common::KEYCODE_q && event.kbd.flags == Common::KBD_CTRL) _vm->quitGame(); else _keyPressed = event.kbd; diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 451750ce14..2c2d6a424b 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -261,9 +261,9 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) switch (event.type) { case Common::EVENT_KEYDOWN: - if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' && + if (event.kbd.keycode >= Common::KEYCODE_1 && event.kbd.keycode <= Common::KEYCODE_9 && (event.kbd.flags == Common::KBD_CTRL || event.kbd.flags == Common::KBD_ALT) && mainLoop) { - int saveLoadSlot = 9 - (event.kbd.keycode - '0') + 990; + int saveLoadSlot = 9 - (event.kbd.keycode - Common::KEYCODE_0) + 990; if (event.kbd.flags == Common::KBD_CTRL) { loadGameStateCheck(saveLoadSlot); @@ -271,14 +271,14 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) breakLoop = true; } else { char savegameName[14]; - sprintf(savegameName, "Quicksave %d", event.kbd.keycode - '0'); + sprintf(savegameName, "Quicksave %d", event.kbd.keycode - Common::KEYCODE_0); saveGameState(saveLoadSlot, savegameName, 0); } } else if (event.kbd.flags == Common::KBD_CTRL) { - if (event.kbd.keycode == 'd') { + if (event.kbd.keycode == Common::KEYCODE_d) { if (_debugger) _debugger->attach(); - } else if (event.kbd.keycode == 'q') { + } else if (event.kbd.keycode == Common::KEYCODE_q) { quitGame(); } } else { @@ -379,12 +379,12 @@ void KyraEngine_v1::updateInput() { while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_KEYDOWN: - if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE || + if (event.kbd.keycode == Common::KEYCODE_PERIOD || event.kbd.keycode == Common::KEYCODE_ESCAPE || event.kbd.keycode == Common::KEYCODE_SPACE || event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_UP || event.kbd.keycode == Common::KEYCODE_RIGHT || event.kbd.keycode == Common::KEYCODE_DOWN || event.kbd.keycode == Common::KEYCODE_LEFT) _eventList.push_back(Event(event, true)); - else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL) + else if (event.kbd.keycode == Common::KEYCODE_q && event.kbd.flags == Common::KBD_CTRL) quitGame(); else _eventList.push_back(event); |