]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/FGKeyboardInput.cxx
AircraftModel hacking for package support.
[flightgear.git] / src / Input / FGKeyboardInput.cxx
index fbbadd249eb3e353bd17518401540d04a30c7a96..8ff3d0a81b9fac1141321c1565240c550332d596 100644 (file)
@@ -169,7 +169,7 @@ const FGCommonInput::binding_list_t & FGKeyboardInput::_find_key_bindings (unsig
   FGButton &b = bindings[k];
 
                                 // Try it straight, first.
-  if (b.bindings[modifiers].size() > 0)
+  if (! b.bindings[modifiers].empty())
     return b.bindings[modifiers];
 
                                 // Alt-Gr is CTRL+ALT
@@ -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 );
     if (!b.last_state || b.is_repeatable) {
       const binding_list_t &bindings = _find_key_bindings(k, modifiers);
-
-      for (unsigned int i = 0; i < bindings.size(); i++)
-        bindings[i]->fire();
+      fireBindingList(bindings);
       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);
     if (b.last_state) {
       const binding_list_t &bindings = _find_key_bindings(k, modifiers);
-      for (unsigned int i = 0; i < bindings.size(); i++)
-        bindings[i]->fire();
+      fireBindingList(bindings);
       b.last_state = 0;
     }
   }