Exemplo n.º 1
0
 private bool setupNewKeyAssociation(ButtonAlias button)
 {
     if (_keyState.IsKeyDown(button.GetKey()) && !_buttonLocks.ContainsKey(button.GetAssociation()))
     {
         button.Pressed = PressType.Key;
         _buttonLocks.Add(button.GetAssociation(), button);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 private bool checkCommandKeyUp(ButtonAlias button)
 {
     if (_keyState.IsKeyUp(button.GetKey()) && _buttonLocks.ContainsValue(button))
     {
         if (_holdTimes.ContainsKey(button.GetAssociation()) && button.GetHoldable() > 0 && _holdTimes[button.GetAssociation()].CompareTo(SystemMain.CurrentGameTime.TotalRealTime.TotalSeconds) < 0 && !_repeatHoldTimes.ContainsKey(button.GetAssociation()))
         {
             _holdTimes.Remove(button.GetAssociation());
             _buttonLocks.Remove(button.GetAssociation());
         }
         else if (_repeatHoldTimes.ContainsKey(button.GetAssociation()) && _repeatHoldTimes[button.GetAssociation()].CompareTo(SystemMain.CurrentGameTime.TotalRealTime.TotalSeconds) < 0)
         {
             _repeatHoldTimes.Remove(button.GetAssociation());
         }
         else if (!_holdTimes.ContainsKey(button.GetAssociation()))
         {
             _buttonLocks.Remove(button.GetAssociation());
         }
         return(false);
     }
     return(true);
 }
Exemplo n.º 3
0
 private bool setupNewKeyAssociation(ButtonAlias button)
 {
     if (_keyState.IsKeyDown(button.GetKey()) && !_buttonLocks.ContainsKey(button.GetAssociation()))
     {
         button.Pressed = PressType.Key;
         _buttonLocks.Add(button.GetAssociation(), button);
         return true;
     }
     return false;
 }
Exemplo n.º 4
0
 private bool checkCommandKeyUp(ButtonAlias button)
 {
     if (_keyState.IsKeyUp(button.GetKey()) && _buttonLocks.ContainsValue(button))
     {
         if (_holdTimes.ContainsKey(button.GetAssociation()) && button.GetHoldable() > 0 && _holdTimes[button.GetAssociation()].CompareTo(SystemMain.CurrentGameTime.TotalRealTime.TotalSeconds) < 0 && !_repeatHoldTimes.ContainsKey(button.GetAssociation()))
         {
             _holdTimes.Remove(button.GetAssociation());
             _buttonLocks.Remove(button.GetAssociation());
         }
         else if (_repeatHoldTimes.ContainsKey(button.GetAssociation()) && _repeatHoldTimes[button.GetAssociation()].CompareTo(SystemMain.CurrentGameTime.TotalRealTime.TotalSeconds) < 0)
         {
             _repeatHoldTimes.Remove(button.GetAssociation());
         }
         else if (!_holdTimes.ContainsKey(button.GetAssociation()))
         {
             _buttonLocks.Remove(button.GetAssociation());
         }
         return false;
     }
     return true;
 }