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/widgets/radiobutton.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/widgets/radiobutton.cpp')
-rw-r--r-- | src/gui/widgets/radiobutton.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index 4a9a912b1..e2a3483fc 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -25,6 +25,8 @@ #include "client.h" #include "configuration.h" #include "graphics.h" +#include "keydata.h" +#include "keyevent.h" #include "gui/theme.h" @@ -161,10 +163,9 @@ void RadioButton::mouseExited(gcn::MouseEvent& event A_UNUSED) void RadioButton::keyPressed(gcn::KeyEvent& keyEvent) { - gcn::Key key = keyEvent.getKey(); + int action = static_cast<KeyEvent*>(&keyEvent)->getActionId(); - if (key.getValue() == gcn::Key::ENTER || - key.getValue() == gcn::Key::SPACE) + if (action == Input::KEY_GUI_SELECT) { setSelected(true); distributeActionEvent(); |