diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-21 22:22:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-21 22:22:47 +0300 |
commit | ba931a717cb5a2549ecdaa1f924dbbf5f896a21b (patch) | |
tree | 3c623bc1ce935c08b749572af439ae4b3b3dbc5b /src/gui | |
parent | 60b40c0c68e9cffbc5f48d4f672d99009488f8b1 (diff) | |
download | manaplus-ba931a717cb5a2549ecdaa1f924dbbf5f896a21b.tar.gz manaplus-ba931a717cb5a2549ecdaa1f924dbbf5f896a21b.tar.bz2 manaplus-ba931a717cb5a2549ecdaa1f924dbbf5f896a21b.tar.xz manaplus-ba931a717cb5a2549ecdaa1f924dbbf5f896a21b.zip |
Rename keyEvent variables into event.
Diffstat (limited to 'src/gui')
42 files changed, 137 insertions, 137 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 2814de4bb..275103a25 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -424,21 +424,21 @@ bool Gui::handleKeyInput() { const KeyInput keyInput = guiInput->dequeueKeyInput(); - KeyEvent keyEventToGlobalKeyListeners(nullptr, + KeyEvent eventToGlobalKeyListeners(nullptr, keyInput.getType(), keyInput.getActionId(), keyInput.getKey()); #ifdef USE_SDL2 if (!keyInput.getText().empty()) - keyEventToGlobalKeyListeners.setText(keyInput.getText()); + eventToGlobalKeyListeners.setText(keyInput.getText()); #endif distributeKeyEventToGlobalKeyListeners( - keyEventToGlobalKeyListeners); + eventToGlobalKeyListeners); // If a global key listener consumes the event it will not be // sent further to the source of the event. - if (keyEventToGlobalKeyListeners.isConsumed()) + if (eventToGlobalKeyListeners.isConsumed()) { consumed = true; continue; @@ -446,33 +446,33 @@ bool Gui::handleKeyInput() if (mFocusHandler) { - bool keyEventConsumed = false; + bool eventConsumed = false; // Send key inputs to the focused widgets if (mFocusHandler->getFocused()) { - KeyEvent keyEvent(getKeyEventSource(), + KeyEvent event(getKeyEventSource(), keyInput.getType(), keyInput.getActionId(), keyInput.getKey()); #ifdef USE_SDL2 if (!keyInput.getText().empty()) - keyEvent.setText(keyInput.getText()); + event.setText(keyInput.getText()); #endif if (!mFocusHandler->getFocused()->isFocusable()) mFocusHandler->focusNone(); else - distributeKeyEvent(keyEvent); + distributeKeyEvent(event); - keyEventConsumed = keyEvent.isConsumed(); - if (keyEventConsumed) + eventConsumed = event.isConsumed(); + if (eventConsumed) consumed = true; } // If the key event hasn't been consumed and // tabbing is enable check for tab press and // change focus. - if (!keyEventConsumed && keyInput.getActionId() + if (!eventConsumed && keyInput.getActionId() == static_cast<int>(Input::KEY_GUI_TAB) && keyInput.getType() == KeyInput::PRESSED) { @@ -1247,10 +1247,10 @@ Widget* Gui::getKeyEventSource() const return widget; } -void Gui::distributeKeyEvent(KeyEvent &keyEvent) const +void Gui::distributeKeyEvent(KeyEvent &event) const { - Widget* parent = keyEvent.getSource(); - Widget* widget = keyEvent.getSource(); + Widget* parent = event.getSource(); + Widget* widget = event.getSource(); if (mFocusHandler->getModalFocused() && !widget->isModalFocused()) return; @@ -1275,7 +1275,7 @@ void Gui::distributeKeyEvent(KeyEvent &keyEvent) const std::list<KeyListener*> keyListeners = widget->_getKeyListeners(); - const unsigned int eventType = keyEvent.getType(); + const unsigned int eventType = event.getType(); // Send the event to all key listeners of the source widget. FOR_EACH (std::list<KeyListener*>::const_iterator, it, keyListeners) @@ -1283,10 +1283,10 @@ void Gui::distributeKeyEvent(KeyEvent &keyEvent) const switch (eventType) { case KeyEvent::PRESSED: - (*it)->keyPressed(keyEvent); + (*it)->keyPressed(event); break; case KeyEvent::RELEASED: - (*it)->keyReleased(keyEvent); + (*it)->keyReleased(event); break; default: break; @@ -1305,24 +1305,24 @@ void Gui::distributeKeyEvent(KeyEvent &keyEvent) const } } -void Gui::distributeKeyEventToGlobalKeyListeners(KeyEvent& keyEvent) +void Gui::distributeKeyEventToGlobalKeyListeners(KeyEvent& event) { - const unsigned int eventType = keyEvent.getType(); + const unsigned int eventType = event.getType(); FOR_EACH (KeyListenerListIterator, it, mKeyListeners) { switch (eventType) { case KeyEvent::PRESSED: - (*it)->keyPressed(keyEvent); + (*it)->keyPressed(event); break; case KeyEvent::RELEASED: - (*it)->keyReleased(keyEvent); + (*it)->keyReleased(event); break; default: break; } - if (keyEvent.isConsumed()) + if (event.isConsumed()) break; } } diff --git a/src/gui/gui.h b/src/gui/gui.h index 7ecb56b21..723c653ca 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -368,20 +368,20 @@ class Gui final /** * Distributes a key event. * - * @param keyEvent The key event to distribute. + * @param event The key event to distribute. * @since 0.6.0 */ - void distributeKeyEvent(KeyEvent &keyEvent) const; + void distributeKeyEvent(KeyEvent &event) const; /** * Distributes a key event to the global key listeners. * - * @param keyEvent The key event to distribute. + * @param event The key event to distribute. * * @since 0.6.0 */ - void distributeKeyEventToGlobalKeyListeners(KeyEvent& keyEvent); + void distributeKeyEventToGlobalKeyListeners(KeyEvent& event); /** * Handles modal mouse input focus. Modal mouse input focus needs diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index 778d74b41..dffcc7814 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -673,20 +673,20 @@ void Button::adjustSize() } } -void Button::keyPressed(KeyEvent& keyEvent) +void Button::keyPressed(KeyEvent& event) { - const int action = keyEvent.getActionId(); + const int action = event.getActionId(); if (action == Input::KEY_GUI_SELECT) { mKeyPressed = true; - keyEvent.consume(); + event.consume(); } } -void Button::keyReleased(KeyEvent& keyEvent) +void Button::keyReleased(KeyEvent& event) { - const int action = keyEvent.getActionId(); + const int action = event.getActionId(); if (action == Input::KEY_GUI_SELECT && mKeyPressed) { @@ -694,7 +694,7 @@ void Button::keyReleased(KeyEvent& keyEvent) if (mStick) mPressed = !mPressed; distributeActionEvent(); - keyEvent.consume(); + event.consume(); } } diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index 200418172..57a024195 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -189,9 +189,9 @@ class Button final : public Widget, void adjustSize(); - void keyPressed(KeyEvent &keyEvent) override final; + void keyPressed(KeyEvent &event) override final; - void keyReleased(KeyEvent &keyEvent) override final; + void keyReleased(KeyEvent &event) override final; bool isPressed2() const A_WARN_UNUSED; diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index fb639753f..06dcecab0 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -235,14 +235,14 @@ void CheckBox::mouseExited(MouseEvent& event A_UNUSED) mHasMouse = false; } -void CheckBox::keyPressed(KeyEvent& keyEvent) +void CheckBox::keyPressed(KeyEvent& event) { - const int action = keyEvent.getActionId(); + const int action = event.getActionId(); if (action == Input::KEY_GUI_SELECT) { toggleSelected(); - keyEvent.consume(); + event.consume(); } } diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index 9882284b0..41f168048 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -126,7 +126,7 @@ class CheckBox final : public Widget, */ void mouseExited(MouseEvent& event) override final; - void keyPressed(KeyEvent& keyEvent) override final; + void keyPressed(KeyEvent& event) override final; void adjustSize(); diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index ba2ffe58d..8b636c04d 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -307,12 +307,12 @@ void DropDown::drawButton(Graphics *graphics) } } -void DropDown::keyPressed(KeyEvent& keyEvent) +void DropDown::keyPressed(KeyEvent& event) { - if (keyEvent.isConsumed()) + if (event.isConsumed()) return; - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); switch (actionId) { case Input::KEY_GUI_SELECT: @@ -344,7 +344,7 @@ void DropDown::keyPressed(KeyEvent& keyEvent) return; } - keyEvent.consume(); + event.consume(); } void DropDown::hideDrop(bool event) diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index a4d1fde1e..cf42cce11 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -83,7 +83,7 @@ class DropDown final : public ActionListener, // Inherited from KeyListener - void keyPressed(KeyEvent& keyEvent) override final; + void keyPressed(KeyEvent& event) override final; // Inherited from MouseListener diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index 44248037c..35e09ce93 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -421,46 +421,46 @@ Rect GuiTable::getChildrenArea() } // -- KeyListener notifications -void GuiTable::keyPressed(KeyEvent& keyEvent) +void GuiTable::keyPressed(KeyEvent& event) { - const int action = keyEvent.getActionId(); + const int action = event.getActionId(); if (action == Input::KEY_GUI_SELECT) { distributeActionEvent(); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_UP) { setSelectedRow(mSelectedRow - 1); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_DOWN) { setSelectedRow(mSelectedRow + 1); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_LEFT) { setSelectedColumn(mSelectedColumn - 1); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_RIGHT) { setSelectedColumn(mSelectedColumn + 1); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_HOME) { setSelectedRow(0); setSelectedColumn(0); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_END && mModel) { setSelectedRow(mModel->getRows() - 1); setSelectedColumn(mModel->getColumns() - 1); - keyEvent.consume(); + event.consume(); } } diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index 9beb866cf..ec3bab728 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -123,7 +123,7 @@ public: void _setFocusHandler(FocusHandler *const focusHandler) override final; // Inherited from KeyListener - void keyPressed(KeyEvent& keyEvent) override final; + void keyPressed(KeyEvent& event) override final; /** * Sets the table to be opaque, that is sets the table diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 1df21af20..c41e32854 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -225,13 +225,13 @@ void ListBox::draw(Graphics *graphics) BLOCK_END("ListBox::draw") } -void ListBox::keyPressed(KeyEvent &keyEvent) +void ListBox::keyPressed(KeyEvent &event) { - const int action = keyEvent.getActionId(); + const int action = event.getActionId(); if (action == Input::KEY_GUI_SELECT) { distributeActionEvent(); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_UP) { @@ -239,7 +239,7 @@ void ListBox::keyPressed(KeyEvent &keyEvent) setSelected(mSelected - 1); else if (mSelected == 0 && mWrappingEnabled && getListModel()) setSelected(getListModel()->getNumberOfElements() - 1); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_DOWN) { @@ -248,17 +248,17 @@ void ListBox::keyPressed(KeyEvent &keyEvent) setSelected(mSelected + 1); else if (mSelected == num && mWrappingEnabled) setSelected(0); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_HOME) { setSelected(0); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_END && getListModel()) { setSelected(getListModel()->getNumberOfElements() - 1); - keyEvent.consume(); + event.consume(); } } diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 9a398dfa2..e425b48ca 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -119,7 +119,7 @@ class ListBox : public Widget, // Inherited from KeyListener - void keyPressed(KeyEvent& keyEvent) override final; + void keyPressed(KeyEvent& event) override final; // Inherited from MouseListener diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index 549e8823e..643517f77 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -235,14 +235,14 @@ void RadioButton::mouseExited(MouseEvent& event A_UNUSED) mHasMouse = false; } -void RadioButton::keyPressed(KeyEvent& keyEvent) +void RadioButton::keyPressed(KeyEvent& event) { - const int action = keyEvent.getActionId(); + const int action = event.getActionId(); if (action == Input::KEY_GUI_SELECT) { setSelected(true); distributeActionEvent(); - keyEvent.consume(); + event.consume(); } } diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h index a0d32dd9d..ec1450f66 100644 --- a/src/gui/widgets/radiobutton.h +++ b/src/gui/widgets/radiobutton.h @@ -120,7 +120,7 @@ class RadioButton final : public Widget, */ void mouseExited(MouseEvent& event) override final; - void keyPressed(KeyEvent& keyEvent) override final; + void keyPressed(KeyEvent& event) override final; void updateAlpha(); diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index c4ff2d2bc..cf9aad03d 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -403,9 +403,9 @@ void Slider::mouseWheelMovedDown(MouseEvent &event) event.consume(); } -void Slider::keyPressed(KeyEvent& keyEvent) +void Slider::keyPressed(KeyEvent& event) { - const int action = keyEvent.getActionId(); + const int action = event.getActionId(); if (mOrientation == HORIZONTAL) { @@ -413,13 +413,13 @@ void Slider::keyPressed(KeyEvent& keyEvent) { setValue(mValue + mStepLength); distributeActionEvent(); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_LEFT) { setValue(mValue - mStepLength); distributeActionEvent(); - keyEvent.consume(); + event.consume(); } } else @@ -428,13 +428,13 @@ void Slider::keyPressed(KeyEvent& keyEvent) { setValue(mValue + mStepLength); distributeActionEvent(); - keyEvent.consume(); + event.consume(); } else if (action == Input::KEY_GUI_DOWN) { setValue(mValue - mStepLength); distributeActionEvent(); - keyEvent.consume(); + event.consume(); } } } diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 5ee81dd10..164048020 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -143,7 +143,7 @@ class Slider final : public Widget, void mouseWheelMovedDown(MouseEvent &event) override final; - void keyPressed(KeyEvent& keyEvent) override final; + void keyPressed(KeyEvent& event) override final; /** * Sets the scale of the slider. diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 410112c55..3cb6cb302 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -727,12 +727,12 @@ void TabbedArea::setDimension(const Rect &dimension) adjustSize(); } -void TabbedArea::keyPressed(KeyEvent& keyEvent) +void TabbedArea::keyPressed(KeyEvent& event) { - if (mBlockSwitching || keyEvent.isConsumed() || !isFocused()) + if (mBlockSwitching || event.isConsumed() || !isFocused()) return; - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); if (actionId == Input::KEY_GUI_LEFT) { @@ -744,7 +744,7 @@ void TabbedArea::keyPressed(KeyEvent& keyEvent) else setSelectedTab(mTabs[index].first); - keyEvent.consume(); + event.consume(); } else if (actionId == Input::KEY_GUI_RIGHT) { @@ -756,7 +756,7 @@ void TabbedArea::keyPressed(KeyEvent& keyEvent) else setSelectedTab(mTabs[index].first); - keyEvent.consume(); + event.consume(); } } diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 710db31f2..578128abf 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -211,7 +211,7 @@ class TabbedArea final : public ActionListener, bool getFollowDownScroll() const A_WARN_UNUSED { return mFollowDownScroll; } - void keyPressed(KeyEvent& keyEvent) override final; + void keyPressed(KeyEvent& event) override final; void setBlockSwitching(const bool b) { mBlockSwitching = b; } diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index 39e585279..b1849e801 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -248,10 +248,10 @@ void TextBox::setText(const std::string& text) adjustSize(); } -void TextBox::keyPressed(KeyEvent& keyEvent) +void TextBox::keyPressed(KeyEvent& event) { - const Key &key = keyEvent.getKey(); - const int action = keyEvent.getActionId(); + const Key &key = event.getKey(); + const int action = event.getActionId(); switch (action) { @@ -430,7 +430,7 @@ void TextBox::keyPressed(KeyEvent& keyEvent) adjustSize(); scrollToCaret(); - keyEvent.consume(); + event.consume(); } void TextBox::draw(Graphics* graphics) diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h index 056f6a0d3..e8c1d3840 100644 --- a/src/gui/widgets/textbox.h +++ b/src/gui/widgets/textbox.h @@ -105,7 +105,7 @@ class TextBox final : public Widget, int getMinWidth() const A_WARN_UNUSED { return mMinWidth; } - void keyPressed(KeyEvent& keyEvent) override final; + void keyPressed(KeyEvent& event) override final; void draw(Graphics* graphics) override final; diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index d7d73f78a..d1f19785f 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -245,16 +245,16 @@ int TextField::getValue() const return value; } -void TextField::keyPressed(KeyEvent &keyEvent) +void TextField::keyPressed(KeyEvent &event) { - const int val = keyEvent.getKey().getValue(); + const int val = event.getKey().getValue(); #ifdef USE_SDL2 if (val == Key::TEXTINPUT) { - std::string str = keyEvent.getText(); + std::string str = event.getText(); mText.insert(mCaretPosition, str); mCaretPosition += str.size(); - keyEvent.consume(); + event.consume(); fixScroll(); if (mSendAlwaysEvents) distributeActionEvent(); @@ -273,7 +273,7 @@ void TextField::keyPressed(KeyEvent &keyEvent) buf[1] = 0; mText.insert(mCaretPosition, std::string(buf)); mCaretPosition += 1; - keyEvent.consume(); + event.consume(); fixScroll(); if (mSendAlwaysEvents) distributeActionEvent(); @@ -305,7 +305,7 @@ void TextField::keyPressed(KeyEvent &keyEvent) mText.insert(mCaretPosition, std::string(buf, buf + len)); mCaretPosition += len; - keyEvent.consume(); + event.consume(); fixScroll(); if (mSendAlwaysEvents) distributeActionEvent(); @@ -323,14 +323,14 @@ void TextField::keyPressed(KeyEvent &keyEvent) bool consumed(false); #endif - const int action = keyEvent.getActionId(); + const int action = event.getActionId(); if (!inputManager.isActionActive(static_cast<int>( Input::KEY_GUI_CTRL))) { if (!handleNormalKeys(action, consumed)) { if (consumed) - keyEvent.consume(); + event.consume(); return; } } @@ -343,7 +343,7 @@ void TextField::keyPressed(KeyEvent &keyEvent) distributeActionEvent(); if (consumed) - keyEvent.consume(); + event.consume(); fixScroll(); } diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 2b0762e86..1af5978b1 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -134,7 +134,7 @@ class TextField : public Widget, /** * Processes one keypress. */ - void keyPressed(KeyEvent &keyEvent) override; + void keyPressed(KeyEvent &event) override; /** * Set the minimum value for a range diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 1df282189..53b4b55ff 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -655,13 +655,13 @@ void CharCreateDialog::updatePlayer() } } -void CharCreateDialog::keyPressed(KeyEvent &keyEvent) +void CharCreateDialog::keyPressed(KeyEvent &event) { - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); switch (actionId) { case Input::KEY_GUI_CANCEL: - keyEvent.consume(); + event.consume(); action(ActionEvent(mCancelButton, mCancelButton->getActionEventId())); break; diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h index 6342450ec..652254776 100644 --- a/src/gui/windows/charcreatedialog.h +++ b/src/gui/windows/charcreatedialog.h @@ -78,7 +78,7 @@ class CharCreateDialog final : public Window, void updatePlayer(); - void keyPressed(KeyEvent &keyEvent) override final; + void keyPressed(KeyEvent &event) override final; private: int getDistributedPoints() const A_WARN_UNUSED; diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 4480f06af..887937232 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -317,20 +317,20 @@ void CharSelectDialog::use(const int selected) } } -void CharSelectDialog::keyPressed(KeyEvent &keyEvent) +void CharSelectDialog::keyPressed(KeyEvent &event) { - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); switch (actionId) { case Input::KEY_GUI_CANCEL: - keyEvent.consume(); + event.consume(); action(ActionEvent(mSwitchLoginButton, mSwitchLoginButton->getActionEventId())); break; case Input::KEY_GUI_RIGHT: { - keyEvent.consume(); + event.consume(); int idx = mCharacterView->getSelected(); if (idx >= 0) { @@ -345,7 +345,7 @@ void CharSelectDialog::keyPressed(KeyEvent &keyEvent) case Input::KEY_GUI_LEFT: { - keyEvent.consume(); + event.consume(); int idx = mCharacterView->getSelected(); if (idx >= 0) { @@ -360,7 +360,7 @@ void CharSelectDialog::keyPressed(KeyEvent &keyEvent) case Input::KEY_GUI_UP: { - keyEvent.consume(); + event.consume(); int idx = mCharacterView->getSelected(); if (idx >= 0) { @@ -375,7 +375,7 @@ void CharSelectDialog::keyPressed(KeyEvent &keyEvent) case Input::KEY_GUI_DOWN: { - keyEvent.consume(); + event.consume(); int idx = mCharacterView->getSelected(); if (idx >= 0) { @@ -390,7 +390,7 @@ void CharSelectDialog::keyPressed(KeyEvent &keyEvent) case Input::KEY_GUI_DELETE: { - keyEvent.consume(); + event.consume(); const int idx = mCharacterView->getSelected(); if (idx >= 0 && mCharacterEntries[idx] && mCharacterEntries[idx]->getCharacter()) @@ -402,7 +402,7 @@ void CharSelectDialog::keyPressed(KeyEvent &keyEvent) case Input::KEY_GUI_SELECT: { - keyEvent.consume(); + event.consume(); use(mCharacterView->getSelected()); break; } diff --git a/src/gui/windows/charselectdialog.h b/src/gui/windows/charselectdialog.h index 38c307f30..cf44f30b9 100644 --- a/src/gui/windows/charselectdialog.h +++ b/src/gui/windows/charselectdialog.h @@ -62,7 +62,7 @@ class CharSelectDialog final : public Window, void action(const ActionEvent &event) override final; - void keyPressed(KeyEvent &keyEvent) override final; + void keyPressed(KeyEvent &event) override final; enum SelectAction { diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 316a7051b..6a25a2d77 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -242,12 +242,12 @@ void EditServerDialog::action(const ActionEvent &event) } } -void EditServerDialog::keyPressed(KeyEvent &keyEvent) +void EditServerDialog::keyPressed(KeyEvent &event) { - if (keyEvent.isConsumed()) + if (event.isConsumed()) return; - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL)) { diff --git a/src/gui/windows/editserverdialog.h b/src/gui/windows/editserverdialog.h index b70d1031b..98f5e07fd 100644 --- a/src/gui/windows/editserverdialog.h +++ b/src/gui/windows/editserverdialog.h @@ -59,7 +59,7 @@ class EditServerDialog final : public Window, */ void action(const ActionEvent &event) override final; - void keyPressed(KeyEvent &keyEvent) override final; + void keyPressed(KeyEvent &event) override final; private: TextField *mServerAddressField; diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index ec581a96e..7db944695 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -388,7 +388,7 @@ void ItemAmountWindow::close() scheduleDelete(); } -void ItemAmountWindow::keyReleased(KeyEvent &keyEvent A_UNUSED) +void ItemAmountWindow::keyReleased(KeyEvent &event A_UNUSED) { mItemAmountSlide->setValue(mItemAmountTextField->getValue()); } diff --git a/src/gui/windows/itemamountwindow.h b/src/gui/windows/itemamountwindow.h index 2a414bb24..d2dca064e 100644 --- a/src/gui/windows/itemamountwindow.h +++ b/src/gui/windows/itemamountwindow.h @@ -82,7 +82,7 @@ class ItemAmountWindow final : public Window, */ void close(); - void keyReleased(KeyEvent &keyEvent) override final; + void keyReleased(KeyEvent &event) override final; /** * Creates the dialog, or bypass it if there aren't enough items. diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index 71abf153a..4db58e911 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -256,15 +256,15 @@ void LoginDialog::action(const ActionEvent &event) } } -void LoginDialog::keyPressed(KeyEvent &keyEvent) +void LoginDialog::keyPressed(KeyEvent &event) { - if (keyEvent.isConsumed()) + if (event.isConsumed()) { mLoginButton->setEnabled(canSubmit()); return; } - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL)) { action(ActionEvent(nullptr, mServerButton->getActionEventId())); diff --git a/src/gui/windows/logindialog.h b/src/gui/windows/logindialog.h index 7150b62c1..1813e1817 100644 --- a/src/gui/windows/logindialog.h +++ b/src/gui/windows/logindialog.h @@ -71,7 +71,7 @@ class LoginDialog final : public Window, /** * Called when a key is pressed in one of the text fields. */ - void keyPressed(KeyEvent &keyEvent) override final; + void keyPressed(KeyEvent &event) override final; void close() override final; diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp index 98aa70c70..560968311 100644 --- a/src/gui/windows/quitdialog.cpp +++ b/src/gui/windows/quitdialog.cpp @@ -203,9 +203,9 @@ void QuitDialog::action(const ActionEvent &event) scheduleDelete(); } -void QuitDialog::keyPressed(KeyEvent &keyEvent) +void QuitDialog::keyPressed(KeyEvent &event) { - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); int dir = 0; switch (actionId) diff --git a/src/gui/windows/quitdialog.h b/src/gui/windows/quitdialog.h index 8ce60d06c..ffcea4122 100644 --- a/src/gui/windows/quitdialog.h +++ b/src/gui/windows/quitdialog.h @@ -64,7 +64,7 @@ class QuitDialog final : public Window, */ void action(const ActionEvent &event) override final; - void keyPressed(KeyEvent &keyEvent) override final; + void keyPressed(KeyEvent &event) override final; private: void placeOption(ContainerPlacer &placer, diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index 50344f223..9c74cbc0d 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -282,14 +282,14 @@ void RegisterDialog::action(const ActionEvent &event) } } -void RegisterDialog::keyPressed(KeyEvent &keyEvent) +void RegisterDialog::keyPressed(KeyEvent &event) { - if (keyEvent.isConsumed()) + if (event.isConsumed()) { mRegisterButton->setEnabled(canSubmit()); return; } - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL)) { action(ActionEvent(nullptr, mCancelButton->getActionEventId())); diff --git a/src/gui/windows/registerdialog.h b/src/gui/windows/registerdialog.h index 1d5b5e48b..90087b5e2 100644 --- a/src/gui/windows/registerdialog.h +++ b/src/gui/windows/registerdialog.h @@ -87,7 +87,7 @@ class RegisterDialog final : public Window, /** * Called when a key is pressed in one of the text fields. */ - void keyPressed(KeyEvent &keyEvent) override; + void keyPressed(KeyEvent &event) override; void close() override; diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index ec4bbebbb..33b6f1599 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -389,18 +389,18 @@ void ServerDialog::action(const ActionEvent &event) } } -void ServerDialog::keyPressed(KeyEvent &keyEvent) +void ServerDialog::keyPressed(KeyEvent &event) { - switch (keyEvent.getActionId()) + switch (event.getActionId()) { case Input::KEY_GUI_CANCEL: - keyEvent.consume(); + event.consume(); client->setState(STATE_EXIT); return; case Input::KEY_GUI_SELECT: case Input::KEY_GUI_SELECT2: - keyEvent.consume(); + event.consume(); action(ActionEvent(nullptr, mConnectButton->getActionEventId())); return; @@ -435,8 +435,8 @@ void ServerDialog::keyPressed(KeyEvent &keyEvent) default: break; } - if (!keyEvent.isConsumed()) - mServersList->keyPressed(keyEvent); + if (!event.isConsumed()) + mServersList->keyPressed(event); } void ServerDialog::valueChanged(const SelectionEvent &) diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h index 60b84f089..88b6a7caf 100644 --- a/src/gui/windows/serverdialog.h +++ b/src/gui/windows/serverdialog.h @@ -74,7 +74,7 @@ class ServerDialog final : public Window, */ void action(const ActionEvent &event) override final; - void keyPressed(KeyEvent &keyEvent) override final; + void keyPressed(KeyEvent &event) override final; /** * Called when the selected value changed in the servers list box. diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 247ef8707..70af8e7ea 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -292,9 +292,9 @@ void UpdaterWindow::action(const ActionEvent &event) } } -void UpdaterWindow::keyPressed(KeyEvent &keyEvent) +void UpdaterWindow::keyPressed(KeyEvent &event) { - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL)) { action(ActionEvent(nullptr, mCancelButton->getActionEventId())); diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h index 39e1e84f3..4874ba8ba 100644 --- a/src/gui/windows/updaterwindow.h +++ b/src/gui/windows/updaterwindow.h @@ -121,7 +121,7 @@ class UpdaterWindow final : public Window, void action(const ActionEvent &event) override final; - void keyPressed(KeyEvent &keyEvent) override final; + void keyPressed(KeyEvent &event) override final; void logic() override final; diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp index 58c1aaee8..963da8f22 100644 --- a/src/gui/windows/worldselectdialog.cpp +++ b/src/gui/windows/worldselectdialog.cpp @@ -118,9 +118,9 @@ void WorldSelectDialog::action(const ActionEvent &event) } } -void WorldSelectDialog::keyPressed(KeyEvent &keyEvent) +void WorldSelectDialog::keyPressed(KeyEvent &event) { - const int actionId = keyEvent.getActionId(); + const int actionId = event.getActionId(); if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL)) { diff --git a/src/gui/windows/worldselectdialog.h b/src/gui/windows/worldselectdialog.h index 9d06ac25e..b91beeece 100644 --- a/src/gui/windows/worldselectdialog.h +++ b/src/gui/windows/worldselectdialog.h @@ -65,7 +65,7 @@ class WorldSelectDialog final : public Window, */ void action(const ActionEvent &event) override final; - void keyPressed(KeyEvent &keyEvent) override final; + void keyPressed(KeyEvent &event) override final; private: WorldListModel *mWorldListModel; |