CLear the key bindings before assigning new ones
This commit is contained in:
parent
f9b85dc2fd
commit
52ebc9ae4b
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue