Ejemplo n.º 1
0
        public bool IsButtonPressed(Buttons button, int delay)
        {
            KeyRepeat repeat = new KeyRepeat();

            if (!ButtonRepeats.ContainsKey(button))
            {
                ButtonRepeats.Add(button, new KeyRepeat());
            }
            else
            {
                repeat = ButtonRepeats[button];
            }
            return(repeat.TimePressed == delay);
        }
Ejemplo n.º 2
0
        public bool IsButtonPressed(Buttons button, int repeatStart, int repeatStep)
        {
            KeyRepeat repeat = new KeyRepeat();

            if (!ButtonRepeats.ContainsKey(button))
            {
                ButtonRepeats.Add(button, new KeyRepeat());
            }
            else
            {
                repeat = ButtonRepeats[button];
            }
            return(IsButtonPressed(button) || (repeat.TimePressed > repeatStart && (repeat.TimePressed - repeatStart) % repeatStep == 0));
        }
Ejemplo n.º 3
0
        public bool IsKeyPressed(Keys key, int repeatStart, int repeatStep)
        {
            KeyRepeat repeat = new KeyRepeat();

            if (!KeyRepeats.ContainsKey(key))
            {
                KeyRepeats.Add(key, new KeyRepeat());
            }
            else
            {
                repeat = KeyRepeats[key];
            }
            return(IsKeyPressed(key) || (repeat.TimePressed > repeatStart && (repeat.TimePressed - repeatStart) % repeatStep == 0));
        }
Ejemplo n.º 4
0
        public bool IsKeyPressed(Keys key, int delay)
        {
            KeyRepeat repeat = new KeyRepeat();

            if (!KeyRepeats.ContainsKey(key))
            {
                KeyRepeats.Add(key, new KeyRepeat());
            }
            else
            {
                repeat = KeyRepeats[key];
            }
            return(repeat.TimePressed == delay);
        }
Ejemplo n.º 5
0
 private static void OnKeyRepeat(Screen s, KeyEvent e)
 {
     KeyRepeat?.Invoke(s, e);
 }