IKeyboardState Interface
Definition
Section titled “Definition”Holds the state of keystrokes by a keyboard.
public interface IKeyboardStateProperties
Section titled “Properties”CapsLock
Section titled “CapsLock”Gets the current state of the Caps Lock key.
bool CapsLock { get; }NumLock
Section titled “NumLock”Gets the current state of the Num Lock key.
bool NumLock { get; }Methods
Section titled “Methods”IsKeyDown(Keys)
Section titled “IsKeyDown(Keys)”Gets whether given key is currently being pressed.
bool IsKeyDown(Keys key)Parameters
Section titled “Parameters”key Keys
The key to query.
Returns
Section titled “Returns”bool
true if the key is pressed; false otherwise.
IsKeyUp(Keys)
Section titled “IsKeyUp(Keys)”Gets whether given key is currently being not pressed.
bool IsKeyUp(Keys key)Parameters
Section titled “Parameters”key Keys
The key to query.
Returns
Section titled “Returns”bool
true if the key is not pressed; false otherwise.
GetPressedKeys()
Section titled “GetPressedKeys()”Returns an array of values holding keys that are currently being pressed.
Keys[] GetPressedKeys()Returns
Section titled “Returns”Keys[]
The keys that are currently being pressed.
Refresh()
Section titled “Refresh()”If applicable to the host implementation, refreshes the keyboard state.
void Refresh()