summaryrefslogtreecommitdiff
path: root/src/gui/quitdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-19 23:48:29 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-19 23:48:29 +0300
commit0b7e752bd177c90a05ca752fa31810f9e34c432c (patch)
treedb1809a48faf051af11c94058e8f126c9e9ef1ab /src/gui/quitdialog.cpp
parent23f87c10db7e6b149e9e1f351e1a82516c545df7 (diff)
downloadmanaverse-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.gz
manaverse-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.bz2
manaverse-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.xz
manaverse-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.cpp15
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: