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); }
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)); }
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)); }
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); }
private static void OnKeyRepeat(Screen s, KeyEvent e) { KeyRepeat?.Invoke(s, e); }