Represents a standard, physical PC-type keyboard.
Inheritance
System.Object
Keyboard
public class Keyboard : InputDevice, ITextInputReceiver
Fields
Total number of key controls on a keyboard, i.e. the number of controls
in allKeys.
Declaration
public const int KeyCount = 110
Field Value
Type |
Description |
System.Int32 |
Total number of key controls.
|
Properties
The 'a' key. The key immediately to the right of capsLockKey.
Declaration
public KeyControl aKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the a key.
|
List of all key controls on the keyboard.
Declaration
public ReadOnlyArray<KeyControl> allKeys { get; }
Property Value
A synthetic button control that is considered pressed if any key on the keyboard is pressed.
Declaration
public AnyKeyControl anyKey { get; }
Property Value
Type |
Description |
AnyKeyControl |
Control representing the synthetic "anyKey".
|
The ` key. The leftmost key in the row of digits. Directly above tabKey.
Declaration
public KeyControl backquoteKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the backtick/quote key.
|
Declaration
public KeyControl backslashKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the backslash key.
|
Declaration
public KeyControl backspaceKey { get; }
Property Value
The 'b' key. The key in-between the vKey to the left and the nKey
to the right in the bottom-most row of alphabetic characters.
Declaration
public KeyControl bKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the b key.
|
Declaration
public KeyControl capsLockKey { get; }
Property Value
The 'c' key. The key in-between the xKey to the left and the vKey
to the right in the bottom-most row of alphabetic characters.
Declaration
public KeyControl cKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the c key.
|
Declaration
public KeyControl commaKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the comma key.
|
Declaration
public KeyControl contextMenuKey { get; }
Property Value
Declaration
public static Keyboard current { get; }
Property Value
Declaration
public KeyControl deleteKey { get; }
Property Value
Declaration
public KeyControl digit0Key { get; }
Property Value
Declaration
public KeyControl digit1Key { get; }
Property Value
Declaration
public KeyControl digit2Key { get; }
Property Value
Declaration
public KeyControl digit3Key { get; }
Property Value
Declaration
public KeyControl digit4Key { get; }
Property Value
Declaration
public KeyControl digit5Key { get; }
Property Value
Declaration
public KeyControl digit6Key { get; }
Property Value
Declaration
public KeyControl digit7Key { get; }
Property Value
Declaration
public KeyControl digit8Key { get; }
Property Value
Declaration
public KeyControl digit9Key { get; }
Property Value
Declaration
public KeyControl dKey { get; }
Property Value
Declaration
public KeyControl downArrowKey { get; }
Property Value
Declaration
public KeyControl eKey { get; }
Property Value
Declaration
public KeyControl endKey { get; }
Property Value
The enter/return key in the main key block.
Declaration
public KeyControl enterKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the enter key.
|
The '=' key in the main key block. The key in-between minusKey to the left
and backspaceKey to the right.
Declaration
public KeyControl equalsKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the equals key.
|
Declaration
public KeyControl escapeKey { get; }
Property Value
Declaration
public KeyControl f10Key { get; }
Property Value
Declaration
public KeyControl f11Key { get; }
Property Value
Declaration
public KeyControl f12Key { get; }
Property Value
Declaration
public KeyControl f1Key { get; }
Property Value
Declaration
public KeyControl f2Key { get; }
Property Value
Declaration
public KeyControl f3Key { get; }
Property Value
Declaration
public KeyControl f4Key { get; }
Property Value
Declaration
public KeyControl f5Key { get; }
Property Value
Declaration
public KeyControl f6Key { get; }
Property Value
Declaration
public KeyControl f7Key { get; }
Property Value
Declaration
public KeyControl f8Key { get; }
Property Value
Declaration
public KeyControl f9Key { get; }
Property Value
Declaration
public KeyControl fKey { get; }
Property Value
Declaration
public KeyControl gKey { get; }
Property Value
Declaration
public KeyControl hKey { get; }
Property Value
Declaration
public KeyControl homeKey { get; }
Property Value
Declaration
public KeyControl iKey { get; }
Property Value
True when IME composition is enabled. Requires SetIMEEnabled(Boolean) to be called to enable IME, and the user to enable it at the OS level.
Declaration
public ButtonControl imeSelected { get; }
Property Value
Declaration
public KeyControl insertKey { get; }
Property Value
Look up a key control by its key code.
Declaration
public KeyControl this[Key key] { get; }
Parameters
Type |
Name |
Description |
Key |
key |
|
Property Value
Exceptions
Type |
Condition |
System.ArgumentException |
The given is not valid.
|
Declaration
public KeyControl jKey { get; }
Property Value
The name of the layout currently used by the keyboard.
Declaration
public string keyboardLayout { get; protected set; }
Property Value
Type |
Description |
System.String |
|
Declaration
public KeyControl kKey { get; }
Property Value
Declaration
public KeyControl leftAltKey { get; }
Property Value
Declaration
public KeyControl leftAppleKey { get; }
Property Value
Declaration
public KeyControl leftArrowKey { get; }
Property Value
Declaration
public KeyControl leftBracketKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the left bracket key.
|
Declaration
public KeyControl leftCommandKey { get; }
Property Value
Declaration
public KeyControl leftCtrlKey { get; }
Property Value
Declaration
public KeyControl leftMetaKey { get; }
Property Value
Declaration
public KeyControl leftShiftKey { get; }
Property Value
Declaration
public KeyControl leftWindowsKey { get; }
Property Value
Declaration
public KeyControl lKey { get; }
Property Value
Declaration
public KeyControl minusKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the minus key.
|
Declaration
public KeyControl mKey { get; }
Property Value
Declaration
public KeyControl nKey { get; }
Property Value
Declaration
public KeyControl numLockKey { get; }
Property Value
Declaration
public KeyControl numpad0Key { get; }
Property Value
Declaration
public KeyControl numpad1Key { get; }
Property Value
Declaration
public KeyControl numpad2Key { get; }
Property Value
Declaration
public KeyControl numpad3Key { get; }
Property Value
Declaration
public KeyControl numpad4Key { get; }
Property Value
Declaration
public KeyControl numpad5Key { get; }
Property Value
Declaration
public KeyControl numpad6Key { get; }
Property Value
Declaration
public KeyControl numpad7Key { get; }
Property Value
Declaration
public KeyControl numpad8Key { get; }
Property Value
Declaration
public KeyControl numpad9Key { get; }
Property Value
Declaration
public KeyControl numpadDivideKey { get; }
Property Value
Declaration
public KeyControl numpadEnterKey { get; }
Property Value
Declaration
public KeyControl numpadEqualsKey { get; }
Property Value
Declaration
public KeyControl numpadMinusKey { get; }
Property Value
Declaration
public KeyControl numpadMultiplyKey { get; }
Property Value
Declaration
public KeyControl numpadPeriodKey { get; }
Property Value
Declaration
public KeyControl numpadPlusKey { get; }
Property Value
Declaration
public KeyControl oem1Key { get; }
Property Value
Declaration
public KeyControl oem2Key { get; }
Property Value
Declaration
public KeyControl oem3Key { get; }
Property Value
Declaration
public KeyControl oem4Key { get; }
Property Value
Declaration
public KeyControl oem5Key { get; }
Property Value
Declaration
public KeyControl oKey { get; }
Property Value
pageDownKey
Declaration
public KeyControl pageDownKey { get; }
Property Value
pageUpKey
Declaration
public KeyControl pageUpKey { get; }
Property Value
Declaration
public KeyControl pauseKey { get; }
Property Value
Declaration
public KeyControl periodKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the period key.
|
Declaration
public KeyControl pKey { get; }
Property Value
Declaration
public KeyControl printScreenKey { get; }
Property Value
Declaration
public KeyControl qKey { get; }
Property Value
The ' key. The key immediately to the left of enterKey.
Declaration
public KeyControl quoteKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the quote key.
|
Declaration
public KeyControl rightAltKey { get; }
Property Value
Declaration
public KeyControl rightAppleKey { get; }
Property Value
Declaration
public KeyControl rightArrowKey { get; }
Property Value
Declaration
public KeyControl rightBracketKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the right bracket key.
|
Declaration
public KeyControl rightCommandKey { get; }
Property Value
Declaration
public KeyControl rightCtrlKey { get; }
Property Value
Declaration
public KeyControl rightMetaKey { get; }
Property Value
Declaration
public KeyControl rightShiftKey { get; }
Property Value
Declaration
public KeyControl rightWindowsKey { get; }
Property Value
Declaration
public KeyControl rKey { get; }
Property Value
Declaration
public KeyControl scrollLockKey { get; }
Property Value
The ';' key. The key immediately to the left of quoteKey.
Declaration
public KeyControl semicolonKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the semicolon key.
|
Declaration
public KeyControl sKey { get; }
Property Value
Declaration
public KeyControl slashKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the forward slash key.
|
Declaration
public KeyControl spaceKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the space bar key.
|
Declaration
public KeyControl tabKey { get; }
Property Value
Type |
Description |
KeyControl |
Control representing the tab key.
|
Declaration
public KeyControl tKey { get; }
Property Value
Declaration
public KeyControl uKey { get; }
Property Value
Declaration
public KeyControl upArrowKey { get; }
Property Value
Declaration
public KeyControl vKey { get; }
Property Value
Declaration
public KeyControl wKey { get; }
Property Value
Declaration
public KeyControl xKey { get; }
Property Value
Declaration
public KeyControl yKey { get; }
Property Value
Declaration
public KeyControl zKey { get; }
Property Value
Methods
Perform final initialization tasks after the control hierarchy has been put into place.
Declaration
protected override void FinishSetup()
Overrides
Make the keyboard the current keyboard (i.e. current).
Declaration
public override void MakeCurrent()
Overrides
Declaration
public void OnIMECompositionChanged(IMECompositionString compositionString)
Parameters
Implements
Declaration
protected override void OnRemoved()
Overrides
OnTextInput(Char)
Declaration
public void OnTextInput(char character)
Parameters
Type |
Name |
Description |
System.Char |
character |
|
Implements
Declaration
protected override void RefreshConfiguration()
Overrides
Sets the cursor position for IME composition dialogs. Units are from the upper left, in pixels, moving down and to the right.
Declaration
public void SetIMECursorPosition(Vector2 position)
Parameters
Type |
Name |
Description |
Vector2 |
position |
|
Activates/deactivates IME composition while typing. This decides whether or not to use the OS supplied IME system.
Declaration
public void SetIMEEnabled(bool enabled)
Parameters
Type |
Name |
Description |
System.Boolean |
enabled |
|
Events
An event that is fired to get IME composition strings. Fired once for every change,
sends the entire string to date, and sends a blank string whenever a composition is submitted or reset.
Declaration
public event Action<IMECompositionString> onIMECompositionChange
Event Type
onTextInput
Event that is fired for every single character entered on the keyboard.
Declaration
public event Action<char> onTextInput
Event Type
Type |
Description |
System.Action<System.Char> |
|
Extension Methods