Velocity API: Device.sendKeys()

Version 2

    Return To Index



    Sends single or multiple key presses to the session.

    Use Cases

    • You want emulate pressing a single or multiple key presses in a script.



    keyMacroThe keys to press or one of the following macro expressions.


    Named Keys. A named key used as a simple readable key value. See Named keys below. For example: {F1}


    Hex Value. A key value expressed in a Unicode hex value. For example: {HEX:000D}


    Autoenter. A key that represents a send key for 5250/3270 or Carriage Return for VT. If Auto Carriage Return is disabled will send nothing. For example: {AutoEnter}


    Pause. Used to create delays between keypresses. A value can be specified after a colon and is in milliseconds. If not specified the default value for a pause is 250 ms. For example: {Pause:1000}


    Script. Used to execute a script. For example: {Script:Device.beep(200,500,50);}



    /* Type the word hello followed by the enter key. 

    Named Keys

    This is a list of all the keys that can be used as a Named Key in a key macro.

    Function Keys


    Name KeyHex Value


    VT control characters


    NameHex Value


    52/32/VT COMMON


    NameHex Value


    5250/3270 COMMON


    NameHex Value


    5250 only


    NameHex Value


    3270 only


    NameHex Value


    VT only


    NameHex Value


    Web only


    NameHex Value