summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index bae1154e3..cde56875f 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -25,6 +25,8 @@
#include "chatlogger.h"
#include "client.h"
#include "configuration.h"
+#include "keydata.h"
+#include "keyevent.h"
#include "logger.h"
#include "main.h"
@@ -396,12 +398,17 @@ void ServerDialog::action(const gcn::ActionEvent &event)
void ServerDialog::keyPressed(gcn::KeyEvent &keyEvent)
{
- gcn::Key key = keyEvent.getKey();
+ int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
- if (key.getValue() == Key::ESCAPE)
+ if (actionId == Input::KEY_GUI_CANCEL)
+ {
Client::setState(STATE_EXIT);
- else if (key.getValue() == Key::ENTER)
+ }
+ else if (actionId == Input::KEY_GUI_SELECT
+ || actionId == Input::KEY_GUI_SELECT2)
+ {
action(gcn::ActionEvent(nullptr, mConnectButton->getActionEventId()));
+ }
}
void ServerDialog::valueChanged(const gcn::SelectionEvent &)