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/charselectdialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gui/charselectdialog.cpp') diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index b1b8009a4..a148376fb 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -26,6 +26,8 @@ #include "game.h" #include "localplayer.h" #include "units.h" +#include "keydata.h" +#include "keyevent.h" #include "logger.h" #include "gui/changeemaildialog.h" @@ -261,9 +263,8 @@ void CharSelectDialog::action(const gcn::ActionEvent &event) void CharSelectDialog::keyPressed(gcn::KeyEvent &keyEvent) { - gcn::Key key = keyEvent.getKey(); - - if (key.getValue() == Key::ESCAPE) + if (static_cast(&keyEvent)->getActionId() + == Input::KEY_GUI_CANCEL) { action(gcn::ActionEvent(mSwitchLoginButton, mSwitchLoginButton->getActionEventId())); -- cgit v1.2.3-60-g2f50