KeyboardKey Class
A key of a keyboard: the values of the attributes of its keyboard events (https://w3c.github.io/uievents/#keyboardevent).
public sealed class KeyboardKey : IEquatable<KeyboardKey>- Implements
Constructors
| Name | Description |
|---|---|
| KeyboardKey(string) | Creates a key whose code, legacy key code, location and text are derived from its key value, as the keys of a US keyboard. |
KeyboardKey(string)
UserInput.Keyboard.csCreates a key whose code, legacy key code, location and text are derived from its key value, as the keys of a US keyboard.
public KeyboardKey(string key)Parameters
keystring- The key value (https://w3c.github.io/uievents-key/): a character (e.g.
a,A,1,?) or the name of a key (e.g.Enter,Shift,ArrowLeft,F1).
Properties
| Name | Description |
|---|---|
| Code | Gets the physical key (the code attribute of the events, https://w3c.github.io/uievents-code/), e.g. KeyA, or the empty string. |
| Key | Gets the key value (the key attribute of the events, https://w3c.github.io/uievents-key/). |
| KeyCode | Gets the legacy virtual key code (the keyCode attribute of the keydown and keyup events), or 0. |
| Location | Gets the location of the key on the keyboard (the location attribute of the events): 0 standard, 1 left, 2 right, 3 numeric keypad. |
| Text | Gets the text that the key inserts in the editable content (the keypress event is fired when it is not empty), e.g. the character of the key, or \r for the Enter key; empty for a key that inserts no text. |
KeyCode
UserInput.Keyboard.csLocation
UserInput.Keyboard.csMethods
| Name | Description |
|---|---|
| Equals(KeyboardKey?) | |
| Equals(object?) | |
| GetHashCode() | |
| ToString() |
Equals overloads
Equals(KeyboardKey?)
public bool Equals(KeyboardKey? other)No documentation is available.
Equals(object?)
GetHashCode()
ToString()
Operators
| Name | Description |
|---|---|
| operator ==(KeyboardKey?, KeyboardKey?) | |
| operator !=(KeyboardKey?, KeyboardKey?) |
operator ==(KeyboardKey?, KeyboardKey?)
public static bool operator ==(KeyboardKey? left, KeyboardKey? right)No documentation is available.
operator !=(KeyboardKey?, KeyboardKey?)
public static bool operator !=(KeyboardKey? left, KeyboardKey? right)No documentation is available.