From 52ebc9ae4bfe48d170047171b17e46a37dca7382 Mon Sep 17 00:00:00 2001 From: ehofman Date: Thu, 25 Sep 2003 12:07:42 +0000 Subject: [PATCH] CLear the key bindings before assigning new ones --- src/Input/input.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Input/input.cxx b/src/Input/input.cxx index df0129559..4a099e4f8 100644 --- a/src/Input/input.cxx +++ b/src/Input/input.cxx @@ -415,7 +415,6 @@ FGInput::doMouseMotion (int x, int y) void FGInput::_init_keyboard () { - // TODO: zero the old bindings first. SG_LOG(SG_INPUT, SG_DEBUG, "Initializing key bindings"); SGPropertyNode * key_nodes = fgGetNode("/input/keyboard"); if (key_nodes == 0) { @@ -427,6 +426,8 @@ FGInput::_init_keyboard () for (unsigned int i = 0; i < keys.size(); i++) { int index = keys[i]->getIndex(); SG_LOG(SG_INPUT, SG_DEBUG, "Binding key " << index); + + _key_bindings[index].bindings->clear(); _key_bindings[index].is_repeatable = keys[i]->getBoolValue("repeatable"); _read_bindings(keys[i], _key_bindings[index].bindings, FG_MOD_NONE); }