summaryrefslogtreecommitdiff
path: root/src/gui/setup_keyboard.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-08 19:41:19 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-08 19:41:19 +0300
commit30ef016b0a14f36dc480284e2d775295b5501dd4 (patch)
treea269c0983efb8dc9160bfe10b1dba26a302aff0c /src/gui/setup_keyboard.cpp
parent25a6eae7f4fb561bbf930be28ee09510b40ebc80 (diff)
downloadmv-30ef016b0a14f36dc480284e2d775295b5501dd4.tar.gz
mv-30ef016b0a14f36dc480284e2d775295b5501dd4.tar.bz2
mv-30ef016b0a14f36dc480284e2d775295b5501dd4.tar.xz
mv-30ef016b0a14f36dc480284e2d775295b5501dd4.zip
Move most input code from keyboardconfig to inputmanager.
Diffstat (limited to 'src/gui/setup_keyboard.cpp')
-rw-r--r--src/gui/setup_keyboard.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp
index 2d8c1c28d..ee06fa4a7 100644
--- a/src/gui/setup_keyboard.cpp
+++ b/src/gui/setup_keyboard.cpp
@@ -23,6 +23,7 @@
#include "gui/setup_keyboard.h"
+#include "inputmanager.h"
#include "keyboardconfig.h"
#include "gui/okdialog.h"
@@ -747,7 +748,7 @@ Setup_Keyboard::Setup_Keyboard():
mKeyList(new ListBox(mKeyListModel)),
mKeySetting(false)
{
- keyboard.setSetupKeyboard(this);
+ inputManager.setSetupKeyboard(this);
setName(_("Keyboard"));
refreshKeys();
@@ -800,7 +801,7 @@ void Setup_Keyboard::apply()
keyUnresolved();
int key1, key2;
- if (keyboard.hasConflicts(key1, key2))
+ if (inputManager.hasConflicts(key1, key2))
{
int s1 = keyToSetupData(key1);
int s2 = keyToSetupData(key2);
@@ -812,14 +813,14 @@ void Setup_Keyboard::apply()
setupActionData[s2].name.c_str()), DIALOG_ERROR);
}
keyboard.setEnabled(true);
- keyboard.store();
+ inputManager.store();
}
void Setup_Keyboard::cancel()
{
keyUnresolved();
- keyboard.retrieve();
+ inputManager.retrieve();
keyboard.setEnabled(true);
refreshKeys();
@@ -858,7 +859,7 @@ void Setup_Keyboard::action(const gcn::ActionEvent &event)
{
const SetupActionData &key = setupActionData[i];
int ik = key.actionId;
- keyboard.setNewKeyIndex(ik);
+ inputManager.setNewKeyIndex(ik);
mKeyListModel->setElementAt(i, std::string(
gettext(key.name.c_str())) + ": ?");
}
@@ -870,15 +871,15 @@ void Setup_Keyboard::action(const gcn::ActionEvent &event)
{
const SetupActionData &key = setupActionData[i];
int ik = key.actionId;
- keyboard.setNewKeyIndex(ik);
+ inputManager.setNewKeyIndex(ik);
refreshAssignedKey(mKeyList->getSelected());
- keyboard.unassignKey();
+ inputManager.unassignKey();
}
mAssignKeyButton->setEnabled(true);
}
else if (event.getId() == "makeDefault")
{
- keyboard.makeDefault();
+ inputManager.makeDefault();
refreshKeys();
}
}
@@ -897,7 +898,7 @@ void Setup_Keyboard::refreshAssignedKey(int index)
{
mKeyListModel->setElementAt(index, strprintf("%s: %s",
gettext(key.name.c_str()),
- keyboard.getKeyStringLong(key.actionId).c_str()));
+ inputManager.getKeyStringLong(key.actionId).c_str()));
}
}
@@ -931,7 +932,7 @@ void Setup_Keyboard::keyUnresolved()
{
if (mKeySetting)
{
- newKeyCallback(keyboard.getNewKeyIndex());
- keyboard.setNewKeyIndex(Input::KEY_NO_VALUE);
+ newKeyCallback(inputManager.getNewKeyIndex());
+ inputManager.setNewKeyIndex(Input::KEY_NO_VALUE);
}
}