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/updaterwindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gui/updaterwindow.cpp') diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index e6ad1818e..a1c625c32 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -24,6 +24,8 @@ #include "client.h" #include "configuration.h" +#include "keydata.h" +#include "keyevent.h" #include "logger.h" #include "main.h" @@ -258,14 +260,15 @@ void UpdaterWindow::action(const gcn::ActionEvent &event) void UpdaterWindow::keyPressed(gcn::KeyEvent &keyEvent) { - gcn::Key key = keyEvent.getKey(); + int actionId = static_cast(&keyEvent)->getActionId(); - if (key.getValue() == Key::ESCAPE) + if (actionId == Input::KEY_GUI_CANCEL) { action(gcn::ActionEvent(nullptr, mCancelButton->getActionEventId())); Client::setState(STATE_LOGIN); } - else if (key.getValue() == Key::ENTER) + else if (actionId == Input::KEY_GUI_SELECT + || actionId == Input::KEY_GUI_SELECT2) { if (mDownloadStatus == UPDATE_COMPLETE || mDownloadStatus == UPDATE_ERROR) -- cgit v1.2.3-60-g2f50