The Open Toolkit library  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
OpenTK.Input.KeyboardDevice Class Reference

Represents a keyboard device and provides methods to query its status. More...

+ Inheritance diagram for OpenTK.Input.KeyboardDevice:

Public Member Functions

override int GetHashCode ()
 Returns the hash code for this KeyboardDevice. More...
 
override string ToString ()
 Returns a System.String representing this KeyboardDevice. More...
 

Properties

bool this[Key key] [get]
 Gets a value indicating the status of the specified Key. More...
 
bool this[uint scancode] [get]
 Gets a value indicating the status of the specified Key. More...
 
int NumberOfKeys [get, set]
 Gets an integer representing the number of keys on this KeyboardDevice. More...
 
int NumberOfFunctionKeys [get, set]
 Gets an integer representing the number of function keys (F-keys) on this KeyboardDevice. More...
 
int NumberOfLeds [get, set]
 Gets a value indicating the number of led indicators on this KeyboardDevice. More...
 
IntPtr DeviceID [get, set]
 Gets an IntPtr representing a device dependent ID. More...
 
bool KeyRepeat [get, set]
 Gets or sets a System.Boolean indicating key repeat status. More...
 
string Description [get, set]
 Gets a System.String which describes this instance. More...
 
InputDeviceType DeviceType [get]
 Gets the InputDeviceType for this instance. More...
 
- Properties inherited from OpenTK.Input.IInputDevice
string Description [get]
 Gets a System.String with a unique description of this IInputDevice instance. More...
 
InputDeviceType DeviceType [get]
 Gets an OpenTK.Input.InputDeviceType value, representing the device type of this IInputDevice instance. More...
 

Events

EventHandler
< KeyboardKeyEventArgs
KeyDown
 Occurs when a key is pressed. More...
 
EventHandler
< KeyboardKeyEventArgs
KeyUp
 Occurs when a key is released. More...
 

Detailed Description

Represents a keyboard device and provides methods to query its status.

Member Function Documentation

override int OpenTK.Input.KeyboardDevice.GetHashCode ( )

Returns the hash code for this KeyboardDevice.

Returns
A 32-bit signed integer hash code.
override string OpenTK.Input.KeyboardDevice.ToString ( )

Returns a System.String representing this KeyboardDevice.

Returns
A System.String representing this KeyboardDevice.

Property Documentation

string OpenTK.Input.KeyboardDevice.Description
getset

Gets a System.String which describes this instance.

IntPtr OpenTK.Input.KeyboardDevice.DeviceID
getset

Gets an IntPtr representing a device dependent ID.

InputDeviceType OpenTK.Input.KeyboardDevice.DeviceType
get

Gets the InputDeviceType for this instance.

bool OpenTK.Input.KeyboardDevice.KeyRepeat
getset

Gets or sets a System.Boolean indicating key repeat status.

If KeyRepeat is true, multiple KeyDown events will be generated while a key is being held. Otherwise only one KeyDown event will be reported.

The rate of the generated KeyDown events is controlled by the Operating System. Usually, one KeyDown event will be reported, followed by a small (250-1000ms) pause and several more KeyDown events (6-30 events per second).

Set to true to handle text input (where keyboard repeat is desirable), but set to false for game input.

int OpenTK.Input.KeyboardDevice.NumberOfFunctionKeys
getset

Gets an integer representing the number of function keys (F-keys) on this KeyboardDevice.

int OpenTK.Input.KeyboardDevice.NumberOfKeys
getset

Gets an integer representing the number of keys on this KeyboardDevice.

int OpenTK.Input.KeyboardDevice.NumberOfLeds
getset

Gets a value indicating the number of led indicators on this KeyboardDevice.

bool OpenTK.Input.KeyboardDevice.this[Key key]
get

Gets a value indicating the status of the specified Key.

Parameters
keyThe Key to check.
Returns
True if the Key is pressed, false otherwise.
bool OpenTK.Input.KeyboardDevice.this[uint scancode]
get

Gets a value indicating the status of the specified Key.

Parameters
scancodeThe scancode to check.
Returns
True if the scancode is pressed, false otherwise.

Event Documentation

EventHandler<KeyboardKeyEventArgs> OpenTK.Input.KeyboardDevice.KeyDown

Occurs when a key is pressed.

EventHandler<KeyboardKeyEventArgs> OpenTK.Input.KeyboardDevice.KeyUp

Occurs when a key is released.