1
0
Fork 0

Use binding-list fire helper.

This commit is contained in:
James Turner 2013-12-15 20:43:27 +00:00
parent df3f842f8a
commit f07042f7d7

View file

@ -231,9 +231,7 @@ void FGKeyboardInput::doKey (int k, int modifiers, int x, int y)
SG_LOG( SG_INPUT, SG_DEBUG, "User pressed key " << k << " with modifiers " << modifiers ); SG_LOG( SG_INPUT, SG_DEBUG, "User pressed key " << k << " with modifiers " << modifiers );
if (!b.last_state || b.is_repeatable) { if (!b.last_state || b.is_repeatable) {
const binding_list_t &bindings = _find_key_bindings(k, modifiers); const binding_list_t &bindings = _find_key_bindings(k, modifiers);
fireBindingList(bindings);
for (unsigned int i = 0; i < bindings.size(); i++)
bindings[i]->fire();
b.last_state = 1; b.last_state = 1;
} }
} }
@ -242,8 +240,7 @@ void FGKeyboardInput::doKey (int k, int modifiers, int x, int y)
SG_LOG(SG_INPUT, SG_DEBUG, "User released key " << k << " with modifiers " << modifiers); SG_LOG(SG_INPUT, SG_DEBUG, "User released key " << k << " with modifiers " << modifiers);
if (b.last_state) { if (b.last_state) {
const binding_list_t &bindings = _find_key_bindings(k, modifiers); const binding_list_t &bindings = _find_key_bindings(k, modifiers);
for (unsigned int i = 0; i < bindings.size(); i++) fireBindingList(bindings);
bindings[i]->fire();
b.last_state = 0; b.last_state = 0;
} }
} }