class KeyEvent

Describes a key input event in the Console.

Implements interface InputEvent. This event is sent to the console's input queue, when the user has pressed or released a key.

Inheritance

class KeyEvent : InputEvent

Properties

int Char ()Returns the ascii character of the pressed / released key.
int ControlKeyState ()Returns the state of the modifier keys shift, alternate and control.
int EventType ()Returns the type number of this event.
int KeyDown ()Returns true if this is a key down event, false if it is a key up event.
int RepeatCount ()For key down events, returns the repeat counter for this key.
int VirtualKeyCode ()Returns the virtual key code of the pressed / released key.
int VirtualScanCode ()Returns the virtual scan code of the pressed / released key.

Reference

accessor int Char ()

Returns the ascii character of the pressed / released key.

If no character is associated with the key (e.g. cursor keys or function keys), this will be 0.


accessor int ControlKeyState ()

Returns the state of the modifier keys shift, alternate and control.


accessor int EventType ()

Returns the type number of this event.

Inherited from InputEvent. Possible values are: Console::FocusEventType, Console::KeyEventType, Console::MenuEventType, Console::MouseEventType, Console::WindowBufferSizeEventType.


accessor int KeyDown ()

Returns true if this is a key down event, false if it is a key up event.


accessor int RepeatCount ()

For key down events, returns the repeat counter for this key.

If the key is held down, auto-repeat will fill the input queue with events for that key, each instance increasing the repeat count by 1.


accessor int VirtualKeyCode ()

Returns the virtual key code of the pressed / released key.


accessor int VirtualScanCode ()

Returns the virtual scan code of the pressed / released key.