Keyboard
Keyboard
The Keyboard module is responsible for performing every keyboard action on the user's computer. Its methods can be accessed as in the example below:
await Keyboard.pressKey["v1_0_0"]({
key: 'Enter'
})
Methods
pressHotKey
Method responsible for pressing hotkeys.
await Keyboard.pressHotKey["v1_0_0"]([
'ctrl',
'alt',
'delete',
])
Key list
alt alt_gr alt_l alt_r backspace caps_lock cmd cmd_l cmd_r ctrl ctrl_l ctrl_r delete down end enter esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home insert left media_next media_play_pause media_previous media_volume_down media_volume_mute media_volume_up menu num_lock page_down page_up pause print_screen right scroll_lock shift shift_l shift_r space tab up win win_ls win_r apps
Required parameters
- This method expects only an array of strings representing the keys that will be pressed together for the shortcut.
Optional parameters
This method has no optional parameters.
Return
This method returns no values.
pressKey
Method responsible for performing the action of pressing a key specified.
await Keyboard.pressKey["v1_0_0"]({
key: 'Enter'
})
Required parameters
key: String - expects a string representing the key that will be pressed.
Optional parameters
times: Integer - expects an integer representing how many times the key will be pressed. Default value:1.delay: Number - expects a number representing the interval in milliseconds between each key press. Default value:1.
Return
This method returns no values.
typeText
Method responsible for performing the action of typing a text specified.
await Keyboard.typeText["v1_0_0"]('Hello World')
Required parameters
- This method expects only a string representing the text that will be typed.
Optional parameters
This method has no optional parameters.
Return
This method returns no values.