From 0b7e752bd177c90a05ca752fa31810f9e34c432c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 19 Apr 2012 23:48:29 +0300 Subject: Dehardcode keys in gui widgets. Add new tab with keys settings in input settings tab. --- src/gui/widgets/checkbox.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gui/widgets/checkbox.cpp') diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index f599e7831..133a5da1d 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -25,6 +25,8 @@ #include "client.h" #include "configuration.h" #include "graphics.h" +#include "keydata.h" +#include "keyevent.h" #include "gui/palette.h" #include "gui/theme.h" @@ -193,10 +195,9 @@ void CheckBox::mouseExited(gcn::MouseEvent& event A_UNUSED) void CheckBox::keyPressed(gcn::KeyEvent& keyEvent) { - gcn::Key key = keyEvent.getKey(); + int action = static_cast(&keyEvent)->getActionId(); - if (key.getValue() == gcn::Key::ENTER || - key.getValue() == gcn::Key::SPACE) + if (action == Input::KEY_GUI_SELECT) { toggleSelected(); keyEvent.consume(); -- cgit v1.2.3-60-g2f50