Gorgon
Show / Hide Table of Contents

Interface IGorgonKeyboard

Provides events and state for keyboard data from an input provider.

Inherited Members
IGorgonRawInputDevice.Handle
IGorgonRawInputDevice.DeviceType
IGorgonRawInputDevice.DeviceUsage
IGorgonRawInputDeviceData<GorgonRawKeyboardData>.ProcessData(in GorgonRawKeyboardData)
Namespace: Gorgon.Input
Assembly: Gorgon.Input.dll
Syntax
public interface IGorgonKeyboard : IGorgonRawInputDevice, IGorgonRawInputDeviceData<GorgonRawKeyboardData>

Properties

| Edit this page View Source

Info

Property to return information about this keyboard.

Declaration
IGorgonKeyboardInfo Info { get; }
Property Value
Type Description
IGorgonKeyboardInfo
| Edit this page View Source

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 Source

KeyToCharacter(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 Source

KeyDown

Event fired when a key is pressed on the keyboard.

Declaration
event EventHandler<GorgonKeyboardEventArgs> KeyDown
Event Type
Type Description
EventHandler<GorgonKeyboardEventArgs>
| Edit this page View Source

KeyUp

Event fired when a key is released on the keyboard.

Declaration
event EventHandler<GorgonKeyboardEventArgs> KeyUp
Event Type
Type Description
EventHandler<GorgonKeyboardEventArgs>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author