diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-19 23:48:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-19 23:48:29 +0300 |
commit | 0b7e752bd177c90a05ca752fa31810f9e34c432c (patch) | |
tree | db1809a48faf051af11c94058e8f126c9e9ef1ab /src/gui/inventorywindow.cpp | |
parent | 23f87c10db7e6b149e9e1f351e1a82516c545df7 (diff) | |
download | manaplus-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.gz manaplus-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.bz2 manaplus-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.xz manaplus-0b7e752bd177c90a05ca752fa31810f9e34c432c.zip |
Dehardcode keys in gui widgets.
Add new tab with keys settings in input settings tab.
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r-- | src/gui/inventorywindow.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 425130b57..5fe44f2bd 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -25,10 +25,11 @@ #include "configuration.h" #include "inventory.h" #include "item.h" -#include "units.h" #include "inputmanager.h" -#include "keyboardconfig.h" +#include "keydata.h" +#include "keyevent.h" #include "playerinfo.h" +#include "units.h" #include "gui/itemamountwindow.h" #include "gui/setup.h" @@ -473,28 +474,14 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) void InventoryWindow::keyPressed(gcn::KeyEvent &event) { - switch (event.getKey().getValue()) - { - case Key::LEFT_SHIFT: - case Key::RIGHT_SHIFT: - mSplit = true; - break; - default: - break; - } + if (static_cast<KeyEvent*>(&event)->getActionId() == Input::KEY_GUI_MOD) + mSplit = true; } void InventoryWindow::keyReleased(gcn::KeyEvent &event) { - switch (event.getKey().getValue()) - { - case Key::LEFT_SHIFT: - case Key::RIGHT_SHIFT: - mSplit = false; - break; - default: - break; - } + if (static_cast<KeyEvent*>(&event)->getActionId() == Input::KEY_GUI_MOD) + mSplit = false; } void InventoryWindow::valueChanged(const gcn::SelectionEvent &event A_UNUSED) |