Interface IKeyboardState
Holds the state of keystrokes by a keyboard.
Namespace: SadConsole.Input
Assembly: SadConsole.dll
Syntax
public interface IKeyboardState
Properties
CapsLock
Gets the current state of the Caps Lock key.
Declaration
bool CapsLock { get; }
Property Value
Type | Description |
---|---|
bool |
NumLock
Gets the current state of the Num Lock key.
Declaration
bool NumLock { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
GetPressedKeys()
Returns an array of values holding keys that are currently being pressed.
Declaration
Keys[] GetPressedKeys()
Returns
Type | Description |
---|---|
Keys[] | The keys that are currently being pressed. |
IsKeyDown(Keys)
Gets whether given key is currently being pressed.
Declaration
bool IsKeyDown(Keys key)
Parameters
Type | Name | Description |
---|---|---|
Keys | key | The key to query. |
Returns
Type | Description |
---|---|
bool | true if the key is pressed; false otherwise. |
IsKeyUp(Keys)
Gets whether given key is currently being not pressed.
Declaration
bool IsKeyUp(Keys key)
Parameters
Type | Name | Description |
---|---|---|
Keys | key | The key to query. |
Returns
Type | Description |
---|---|
bool | true if the key is not pressed; false otherwise. |
Refresh()
If applicable to the host implementation, refreshes the keyboard state.
Declaration
void Refresh()