Constructor
new Keyboard(id)
Each device is associated a unique ID
like keyboard1
, keyboard2
.
Parameters:
Name | Type | Description |
---|---|---|
id |
string |
The unique ID of the device |
- Source:
Extends
Methods
Up(key)
Unpress the specified key on the keyboard
This method will be added to the action's tick
property. prefixed with the Keyboard's ID.
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
The key to unpress. You can use special keys defined in Actions#Keys |
- Source:
Example
var actions = new Actions( new Pointer('bigKeyboard'))
actions.tick.bigKeyboardDown('a').
tick.bigKeyboardUp('a')
actions.tick.bigKeyboardDown(Actions.Keys.ENTER)
.tick.bigKeyboardUp(Actions.Keys.ENTER)
Down(key)
Press the specified key on the keyboard
This method will be added to the action's tick
property. prefixed with the Keyboard's ID.
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
The key to press. You can use special keys defined in Actions#Keys |
- Source:
Example
var actions = new Actions( new Pointer('bigKeyboard'))
actions.tick.bigKeyboardDown('a').
tick.bigKeyboardUp('a')
actions.tick.bigKeyboardDown(Actions.Keys.ENTER)
.tick.bigKeyboardUp(Actions.Keys.ENTER)
Pause(duration)
Pause the keyboard for the specified length of time
This method will be added to the action's tick
property. prefixed with the Keyboard's ID.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
duration |
number | 0 |
Duration of the pause |
- Source: