Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/keyboard.cc')
-rw-r--r--src/client/keyboard.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/client/keyboard.cc b/src/client/keyboard.cc
index b05aaa8..fe6496f 100644
--- a/src/client/keyboard.cc
+++ b/src/client/keyboard.cc
@@ -253,8 +253,8 @@ Keyboard::Keyboard()
add_control("Roll left", "+rollleft", "q");
add_control("Roll right", "+rollright", "e");
- add_control("Decrease thruster", "+thrustdown", "kpmin");
- add_control("Increase thruster", "+thrustup", "kpplus");
+ add_control("Increase thruster", "+thrustup", "mwheelup");
+ add_control("Decrease thruster", "+thrustdown", "mwheeldown");
add_control("Aferburner", "+afterburner", "w");
add_control("Reverse engine", "+reverse", "s");
@@ -382,6 +382,9 @@ void Keyboard::load_binds()
}
con_print << " reading keyboard binds from " << filename << std::endl;
+
+ // clear default configuration
+ unbindall();
char line[MAXCMDSIZE];
while (ifs.getline(line, MAXCMDSIZE - 1)) {
@@ -393,6 +396,21 @@ void Keyboard::load_binds()
load_controls();
}
+
+// load keybinds from control definitions
+void Keyboard::load_defaults()
+{
+ for (Controls::iterator cit = _controls.begin(); cit != _controls.end(); ++cit)
+ {
+ Control *control = *cit;
+
+ std::stringstream str;
+ str << "bind " << control->defaultkeyname() << " " << control->command();
+ core::CommandBuffer::exec(str.str().c_str());
+ }
+}
+
+// load control keys from binds
void Keyboard::load_controls()
{
for (Controls::iterator cit = _controls.begin(); cit != _controls.end(); ++cit)