diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-19 23:48:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-19 23:48:29 +0300 |
commit | 0b7e752bd177c90a05ca752fa31810f9e34c432c (patch) | |
tree | db1809a48faf051af11c94058e8f126c9e9ef1ab /src/gui/quitdialog.cpp | |
parent | 23f87c10db7e6b149e9e1f351e1a82516c545df7 (diff) | |
download | mv-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.gz mv-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.bz2 mv-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.xz mv-0b7e752bd177c90a05ca752fa31810f9e34c432c.zip |
Dehardcode keys in gui widgets.
Add new tab with keys settings in input settings tab.
Diffstat (limited to 'src/gui/quitdialog.cpp')
-rw-r--r-- | src/gui/quitdialog.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp index a0f734adf..51458cb08 100644 --- a/src/gui/quitdialog.cpp +++ b/src/gui/quitdialog.cpp @@ -23,6 +23,8 @@ #include "gui/quitdialog.h" #include "client.h" +#include "keydata.h" +#include "keyevent.h" #include "gui/chatwindow.h" #include "gui/npcdialog.h" @@ -157,22 +159,23 @@ void QuitDialog::action(const gcn::ActionEvent &event) void QuitDialog::keyPressed(gcn::KeyEvent &keyEvent) { - const gcn::Key &key = keyEvent.getKey(); + int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId(); int dir = 0; - switch (key.getValue()) + switch (actionId) { - case Key::ENTER: + case Input::KEY_GUI_SELECT: + case Input::KEY_GUI_SELECT2: action(gcn::ActionEvent(nullptr, mOkButton->getActionEventId())); break; - case Key::ESCAPE: + case Input::KEY_GUI_CANCEL: action(gcn::ActionEvent(nullptr, mCancelButton->getActionEventId())); break; - case Key::UP: + case Input::KEY_GUI_UP: dir = -1; break; - case Key::DOWN: + case Input::KEY_GUI_DOWN: dir = 1; break; default: |