diff options
Diffstat (limited to 'src/gui/widgets/button.cpp')
-rw-r--r-- | src/gui/widgets/button.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index 88d9311b9..15af963b0 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -26,6 +26,8 @@ #include "configuration.h" #include "graphics.h" #include "graphicsvertexes.h" +#include "keydata.h" +#include "keyevent.h" #include "logger.h" #include "gui/palette.h" @@ -462,9 +464,9 @@ void Button::setCaption(const std::string& caption) void Button::keyPressed(gcn::KeyEvent& keyEvent) { - gcn::Key key = keyEvent.getKey(); + int action = static_cast<KeyEvent*>(&keyEvent)->getActionId(); - if (key.getValue() == gcn::Key::SPACE) + if (action == Input::KEY_GUI_SELECT) { mKeyPressed = true; keyEvent.consume(); @@ -473,9 +475,9 @@ void Button::keyPressed(gcn::KeyEvent& keyEvent) void Button::keyReleased(gcn::KeyEvent& keyEvent) { - gcn::Key key = keyEvent.getKey(); + int action = static_cast<KeyEvent*>(&keyEvent)->getActionId(); - if (key.getValue() == gcn::Key::SPACE && mKeyPressed) + if (action == Input::KEY_GUI_SELECT && mKeyPressed) { mKeyPressed = false; if (mStick) |