new Keyboard()
A class that enables low-level keyboard operations.
Members
Keys
The Keys enum.
Properties:
Name | Type | Description |
---|---|---|
space |
string | The Space key. |
escape |
string | The Escape key. |
tab |
string | The Tab key. |
alt |
string | The Alt key. |
leftAlt |
string | The Left Alt key. |
rightAlt |
string | The Right Alt key. |
control |
string | The Control key. |
leftControl |
string | The Left Control key. |
rightControl |
string | The Right Control key. |
shift |
string | The Shift key. |
leftShift |
string | The Left Shift. |
rightShift |
string | The Right Shift. |
system |
string | The System key. |
leftSystem |
string | The Left System key. |
rightSystem |
string | The Right System key. |
f1 |
string | The F1 key. |
f2 |
string | The F2 key. |
f3 |
string | The F3 key. |
f4 |
string | The F4 key. |
f5 |
string | The F5 key. |
f6 |
string | The F6 key. |
f7 |
string | The F7 key. |
f8 |
string | The F8 key. |
f9 |
string | The F9 key. |
f10 |
string | The F10 key. |
f11 |
string | The F11 key. |
f12 |
string | The F12 key. |
d0 |
string | The 0 key. |
d1 |
string | The 1 key. |
d2 |
string | The 2 key. |
d3 |
string | The 3 key. |
d4 |
string | The 4 key. |
d5 |
string | The 5 key. |
d6 |
string | The 6 key. |
d7 |
string | The 7 key. |
d8 |
string | The 8 key. |
d9 |
string | The 9 key. |
a |
string | The A key. |
b |
string | The B key. |
c |
string | The C key. |
d |
string | The D key. |
e |
string | The E key. |
f |
string | The F key. |
g |
string | The G key. |
h |
string | The H key. |
i |
string | The I key. |
j |
string | The J key. |
k |
string | The K key. |
l |
string | The L key. |
m |
string | The M key. |
n |
string | The N key. |
o |
string | The O key. |
p |
string | The P key. |
q |
string | The Q key. |
r |
string | The R key. |
s |
string | The S key. |
t |
string | The T key. |
u |
string | The U key. |
v |
string | The V key. |
w |
string | The W key. |
x |
string | The X key. |
y |
string | The Y key. |
z |
string | The Z key. |
grave |
string | The Grave key. |
minus |
string | The Minus key. |
equal |
string | The Equal key. |
backspace |
string | The Backspace key. |
leftBracket |
string | The Left Bracket key. |
rightBracket |
string | The Right Bracket key. |
backslash |
string | The Backslash key. |
semicolon |
string | The Semicolon key. |
quote |
string | The Quote key. |
return |
string | The Return key. |
comma |
string | The Comma key. |
period |
string | The Period key. |
slash |
string | The Slash key. |
left |
string | The Left key. |
up |
string | The Up key. |
right |
string | The Right key. |
down |
string | The Down key. |
print |
string | The Print key. |
pause |
string | The Pause key. |
insert |
string | The Insert key. |
delete |
string | The Delete key. |
home |
string | The Home key. |
end |
string | The End key. |
pageUp |
string | The Page Up key. |
pageDown |
string | The Page Down key. |
add |
string | The Add key. |
subtract |
string | The Subtract key. |
multiply |
string | The Multiply key. |
divide |
string | The Divide key. |
decimal |
string | The Decimal key. |
enter |
string | The Enter key. |
num0 |
string | /// The Num 0 key. |
num1 |
string | /// The Num 1 key. |
num2 |
string | /// The Num 2 key. |
num3 |
string | /// The Num 3 key. |
num4 |
string | /// The Num 4 key. |
num5 |
string | /// The Num 5 key. |
num6 |
string | /// The Num 6 key. |
num7 |
string | /// The Num 7 key. |
num8 |
string | /// The Num 8 key. |
num9 |
string | /// The Num 9 key. |
capslock |
string | /// The CapsLock key. |
scrolllock |
string | /// The ScrollLock key. |
numlock |
string | /// The NumLock key. |
Methods
keyDown(@param) → {Promise.<void>}
Presses and holds the specified key using a keyboard virtual key.
Parameters:
Name | Type | Description |
---|---|---|
@param |
Keyboard.Keys | key The keyboard code of the key to hold. |
Returns:
a promise that is fulfilled after pressing and holding the specified key.
- Type
- Promise.<void>
keyUp(key) → {Promise.<void>}
Releases the specified key based on its keyboard virtual key.
Parameters:
Name | Type | Description |
---|---|---|
key |
Keyboard.Keys | The keyboard code of the key to release. |
Returns:
a promise that is fulfilled after releasing the specified key.
- Type
- Promise.<void>
pressKey(key) → {Promise.<void>}
Presses the specified key using a keyboard virtual key.
Parameters:
Name | Type | Description |
---|---|---|
key |
Keyboard.Keys | The keyboard scan code of the key. |
Returns:
a promise that is fulfilled after pressing the specified key.
- Type
- Promise.<void>
sendString(stringToSend) → {Promise.<void>}
Types the specified string.
Parameters:
Name | Type | Description |
---|---|---|
stringToSend |
string | The string to type. |
Returns:
a promise that is fulfilled after typing the specified string.
- Type
- Promise.<void>