/// <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)); }
/// <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)); }
/// <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)); }