Keyboard

Keyboard

new Keyboard()

A class that enables low-level keyboard operations.

Members

Keys

The Keys enum.
Properties:
NameTypeDescription
spacestringThe Space key.
escapestringThe Escape key.
tabstringThe Tab key.
altstringThe Alt key.
leftAltstringThe Left Alt key.
rightAltstringThe Right Alt key.
controlstringThe Control key.
leftControlstringThe Left Control key.
rightControlstringThe Right Control key.
shiftstringThe Shift key.
leftShiftstringThe Left Shift.
rightShiftstringThe Right Shift.
systemstringThe System key.
leftSystemstringThe Left System key.
rightSystemstringThe Right System key.
f1stringThe F1 key.
f2stringThe F2 key.
f3stringThe F3 key.
f4stringThe F4 key.
f5stringThe F5 key.
f6stringThe F6 key.
f7stringThe F7 key.
f8stringThe F8 key.
f9stringThe F9 key.
f10stringThe F10 key.
f11stringThe F11 key.
f12stringThe F12 key.
d0stringThe 0 key.
d1stringThe 1 key.
d2stringThe 2 key.
d3stringThe 3 key.
d4stringThe 4 key.
d5stringThe 5 key.
d6stringThe 6 key.
d7stringThe 7 key.
d8stringThe 8 key.
d9stringThe 9 key.
astringThe A key.
bstringThe B key.
cstringThe C key.
dstringThe D key.
estringThe E key.
fstringThe F key.
gstringThe G key.
hstringThe H key.
istringThe I key.
jstringThe J key.
kstringThe K key.
lstringThe L key.
mstringThe M key.
nstringThe N key.
ostringThe O key.
pstringThe P key.
qstringThe Q key.
rstringThe R key.
sstringThe S key.
tstringThe T key.
ustringThe U key.
vstringThe V key.
wstringThe W key.
xstringThe X key.
ystringThe Y key.
zstringThe Z key.
gravestringThe Grave key.
minusstringThe Minus key.
equalstringThe Equal key.
backspacestringThe Backspace key.
leftBracketstringThe Left Bracket key.
rightBracketstringThe Right Bracket key.
backslashstringThe Backslash key.
semicolonstringThe Semicolon key.
quotestringThe Quote key.
returnstringThe Return key.
commastringThe Comma key.
periodstringThe Period key.
slashstringThe Slash key.
leftstringThe Left key.
upstringThe Up key.
rightstringThe Right key.
downstringThe Down key.
printstringThe Print key.
pausestringThe Pause key.
insertstringThe Insert key.
deletestringThe Delete key.
homestringThe Home key.
endstringThe End key.
pageUpstringThe Page Up key.
pageDownstringThe Page Down key.
addstringThe Add key.
subtractstringThe Subtract key.
multiplystringThe Multiply key.
dividestringThe Divide key.
decimalstringThe Decimal key.
enterstringThe Enter key.
num0string/// The Num 0 key.
num1string/// The Num 1 key.
num2string/// The Num 2 key.
num3string/// The Num 3 key.
num4string/// The Num 4 key.
num5string/// The Num 5 key.
num6string/// The Num 6 key.
num7string/// The Num 7 key.
num8string/// The Num 8 key.
num9string/// The Num 9 key.
capslockstring/// The CapsLock key.
scrolllockstring/// The ScrollLock key.
numlockstring/// The NumLock key.

Methods

keyDown(@param) → {Promise.<void>}

Presses and holds the specified key using a keyboard virtual key.
Parameters:
NameTypeDescription
@paramKeyboard.Keyskey 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:
NameTypeDescription
keyKeyboard.KeysThe 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:
NameTypeDescription
keyKeyboard.KeysThe 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:
NameTypeDescription
stringToSendstringThe string to type.
Returns:
a promise that is fulfilled after typing the specified string.
Type
Promise.<void>