Class KeyDownEventArgs
This event is triggered when a keyboard key is pressed.
Inherited Members
Namespace: OpenTK.Platform
Assembly: OpenTK.Platform.dll
Syntax
public class KeyDownEventArgs : WindowEventArgs
Remarks
Do not use this event to handle typing, use TextInputEventArgs instead.
Constructors
KeyDownEventArgs(WindowHandle, Key, Scancode, bool, KeyModifier)
Initializes a new instance of the KeyDownEventArgs class.
Declaration
public KeyDownEventArgs(WindowHandle window, Key key, Scancode scancode, bool isRepeat, KeyModifier modifiers)
Parameters
Type | Name | Description |
---|---|---|
WindowHandle | window | The window which received this keypress. |
Key | key | The key that was pressed. |
Scancode | scancode | The scancode representing the key. |
bool | isRepeat | True if this event is triggered by holding down the key, false otherwise. |
KeyModifier | modifiers | The keyboard modifiers that where down while this key was pressed. |
Properties
IsRepeat
Whether this event is caused by holding down this key or not.
Declaration
public bool IsRepeat { get; }
Property Value
Type | Description |
---|---|
bool |
Key
The virtual key that was pressed. FIXME: Document difference between Key and Scancode.
Declaration
public Key Key { get; }
Property Value
Type | Description |
---|---|
Key |
Modifiers
The keyboard modifiers that where down while this key was pressed.
Declaration
public KeyModifier Modifiers { get; }
Property Value
Type | Description |
---|---|
KeyModifier |
Scancode
The scancode of the key pressed. FIXME: Document difference between Key and Scancode.
Declaration
public Scancode Scancode { get; }
Property Value
Type | Description |
---|---|
Scancode |