OpenTK.Input.KeyboardDevice Class Reference

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

Inheritance diagram for OpenTK.Input.KeyboardDevice:
OpenTK.Input.IInputDevice

List of all members.

Public Member Functions

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

Properties

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

Events

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

Detailed Description

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

Definition at line 21 of file KeyboardDevice.cs.


Member Function Documentation

override int OpenTK.Input.KeyboardDevice.GetHashCode (  ) 

Returns the hash code for this KeyboardDevice.

Returns:
A 32-bit signed integer hash code.

Definition at line 174 of file KeyboardDevice.cs.

00175         {
00176             //return base.GetHashCode();
00177             return (int)(numKeys ^ numFKeys ^ numLeds ^ devID.GetHashCode() ^ description.GetHashCode());
00178         }

override string OpenTK.Input.KeyboardDevice.ToString (  ) 

Returns a System.String representing this KeyboardDevice.

Returns:
A System.String representing this KeyboardDevice.

Definition at line 184 of file KeyboardDevice.cs.

00185         {
00186             //return base.ToString();
00187             return String.Format("ID: {0} ({1}). Keys: {2}, Function keys: {3}, Leds: {4}",
00188                 DeviceID, Description, NumberOfKeys, NumberOfFunctionKeys, NumberOfLeds);
00189         }


Property Documentation

string OpenTK.Input.KeyboardDevice.Description [get, set]

Gets a System.String which describes this instance.

Implements OpenTK.Input.IInputDevice.

Definition at line 155 of file KeyboardDevice.cs.

IntPtr OpenTK.Input.KeyboardDevice.DeviceID [get, set]

Gets an IntPtr representing a device dependent ID.

Definition at line 98 of file KeyboardDevice.cs.

InputDeviceType OpenTK.Input.KeyboardDevice.DeviceType [get]

Gets the InputDeviceType for this instance.

Implements OpenTK.Input.IInputDevice.

Definition at line 164 of file KeyboardDevice.cs.

bool OpenTK.Input.KeyboardDevice.KeyRepeat [get, set]

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.

Definition at line 122 of file KeyboardDevice.cs.

int OpenTK.Input.KeyboardDevice.NumberOfFunctionKeys [get, set]

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

Definition at line 80 of file KeyboardDevice.cs.

int OpenTK.Input.KeyboardDevice.NumberOfKeys [get, set]

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

Definition at line 71 of file KeyboardDevice.cs.

int OpenTK.Input.KeyboardDevice.NumberOfLeds [get, set]

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

Definition at line 89 of file KeyboardDevice.cs.

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

Gets a value indicating the status of the specified Key.

Parameters:
key The Key to check.
Returns:
True if the Key is pressed, false otherwise.

Definition at line 45 of file KeyboardDevice.cs.


Event Documentation

EventHandler<KeyboardKeyEventArgs> OpenTK.Input.KeyboardDevice.KeyDown

Occurs when a key is pressed.

Definition at line 134 of file KeyboardDevice.cs.

EventHandler<KeyboardKeyEventArgs> OpenTK.Input.KeyboardDevice.KeyUp

Occurs when a key is released.

Definition at line 143 of file KeyboardDevice.cs.

 All Classes Functions Variables Enumerations Properties Events

Generated on Tue Mar 9 15:06:30 2010 for The Open Toolkit library by  doxygen 1.6.1