Show / Hide Table of Contents

Class KeyDownEventArgs

This event is triggered when a keyboard key is pressed.

Inheritance
object
EventArgs
WindowEventArgs
KeyDownEventArgs
Inherited Members
WindowEventArgs.Window
EventArgs.Empty
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OpenTK.Core.Platform
Assembly: OpenTK.Core.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
In this article
Back to top Generated by DocFX