Interface IGorgonKeyboard
Provides events and state for keyboard data from an input provider.
Inherited Members
Namespace: Gorgon.Input
Assembly: Gorgon.Input.dll
Syntax
public interface IGorgonKeyboard : IGorgonRawInputDevice, IGorgonRawInputDeviceData<GorgonRawKeyboardData>
Properties
| Edit this page View SourceInfo
Property to return information about this keyboard.
Declaration
IGorgonKeyboardInfo Info { get; }
Property Value
Type | Description |
---|---|
IGorgonKeyboardInfo |
KeyStates
Property to return the states for each of the Keys.
Declaration
GorgonKeyStateCollection KeyStates { get; }
Property Value
Type | Description |
---|---|
GorgonKeyStateCollection |
Methods
| Edit this page View SourceKeyToCharacter(Keys, Keys)
Function to convert a keyboard key into a character (if applicable).
Declaration
string KeyToCharacter(Keys key, Keys modifier)
Parameters
Type | Name | Description |
---|---|---|
Keys | key | The key to convert into a character. |
Keys | modifier | The modifier for that key. |
Returns
Type | Description |
---|---|
string | The character representation for the key. If no representation is available, an empty string is returned. |
Remarks
Use this to retrieve the character associated with a keyboard key. For example, if A is pressed, then 'a' will be returned. A modifier
can be
passed with the ShiftKey to return 'A'.
This method also supports the AltGr key which is represented by a combination of the ControlKey | Menu keys.
This method only returns characters for the currently active keyboard layout (i.e. the system keyboard layout). If this keyboard interface represents another keyboard attached to the computer then it will default to using the system keyboard to retrieve the character.
Events
| Edit this page View SourceKeyDown
Event fired when a key is pressed on the keyboard.
Declaration
event EventHandler<GorgonKeyboardEventArgs> KeyDown
Event Type
Type | Description |
---|---|
EventHandler<GorgonKeyboardEventArgs> |
KeyUp
Event fired when a key is released on the keyboard.
Declaration
event EventHandler<GorgonKeyboardEventArgs> KeyUp
Event Type
Type | Description |
---|---|
EventHandler<GorgonKeyboardEventArgs> |