Ejemplo n.º 1
0
 /// <summary>
 /// Check if a key got released. Triggered once per keystroke
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public bool CheckReleased(Keys key)
 {
     return(!PressedKeys.Contains(key) && LastPressedKeys.Contains(key));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Check if a key got pressed or released. Triggered on the falling and rising edge of a keystroke.
 /// </summary>
 public bool CheckEdge(Keys key)
 {
     return(PressedKeys.Contains(key) ^ LastPressedKeys.Contains(key));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Returns true on the frame that the key was pressed. Triggered once per keystroke
 /// </summary>
 public bool CheckPressed(Keys key)
 {
     return(PressedKeys.Contains(key) && !LastPressedKeys.Contains(key));
 }