User Tools

Site Tools


en:code:device:keyboard

Keyboard

This object allows you to simulate keyboard actions.

Functions

Keyboard

Constructor function.

Syntax

var myObject = new Keyboard();

Methods

pressKey

Presses a key.

Syntax

myObject.pressKey(key);

Arguments

  1. key - (string) the key to press

Returns

  • (Keyboard) this Keyboard

Exceptions

  • (PressKeyError) unable to press the key

Notes

The key parameter can be a single letter or a key name.

releaseKey

Releases a key.

Syntax

myObject.releaseKey(key);

Arguments

  1. key - (string) the key to release

Returns

  • (Keyboard) this Keyboard

Exceptions

  • (ReleaseKeyError) unable to release the key

Notes

The key parameter can be a single letter or a key name.

triggerKey

Triggers a key. (press and release)

Syntax

myObject.triggerKey(key);

Arguments

  1. key - (string) the key to trigger

Returns

  • (Keyboard) this Keyboard

Exceptions

  • (TriggerKeyError) unable to trigger the key

Notes

The key parameter can be a single letter or a key name.

writeText

Write text.

Syntax

myObject.writeText(text);
myObject.writeText(text, delay);

Arguments

  1. text - (string) the text to write
  2. delay - (int) the pause duration (milliseconds) between each character [Added in Actionaz 3.5.0.]

Returns

  • (Keyboard) this Keyboard

Exceptions

  • (WriteTextError) unable to write the text
en/code/device/keyboard.txt · Last modified: 2016/10/09 11:10 (external edit)