Exemplo n.º 1
0
        public static void ExecuteOnToggle(List<Buttons> buttons, GamePadState oldState, GamePadState newState, Utility.Delegate_Paramless execute)
        {
            bool isOneToggled = false;

            foreach (Buttons button in buttons)
                isOneToggled |= IsButtonToggled(button, oldState, newState);

            if (isOneToggled)
                execute();
        }
Exemplo n.º 2
0
        public static void ExecuteOnToggle(List<Keys> keys, KeyboardState oldState, KeyboardState newState, Utility.Delegate_Paramless execute)
        {
            bool isOneToggled = false;

            foreach (Keys key in keys)
                isOneToggled |= IsKeyToggled(key, oldState, newState) && !IsModifierUsed(newState);

            if(isOneToggled)
                execute();
        }
Exemplo n.º 3
0
        public static void ExecuteOnToggle(List<Tuple<Keys, Keys>> keys, KeyboardState oldState, KeyboardState newState, Utility.Delegate_Paramless execute)
        {
            bool isOneToggled = false;

            foreach (Tuple<Keys,Keys> key in keys)
                isOneToggled |= IsKeyToggled(key.Item2, oldState, newState) && newState.IsKeyDown(key.Item1);

            if(isOneToggled)
                execute();
        }
Exemplo n.º 4
0
 public static void ExecuteOnToggle(Buttons button, GamePadState oldState, GamePadState newState, Utility.Delegate_Paramless execute)
 {
     if(IsButtonToggled(button, oldState, newState))
         execute();
 }
Exemplo n.º 5
0
 public static void ExecuteOnToggle(Keys key, KeyboardState oldState, KeyboardState newState, Utility.Delegate_Paramless execute)
 {
     if(IsKeyToggled(key, oldState, newState))
         execute();
 }