sendTouchEvent()

The function sends a touch event to a target.

Synopsis

int sendTouchEvent(string|shape target, mapping| dyn_mapping touchPoints);

Parameters

Parameter Description
target
  • empty string:

    Window in which the script is attached or the currently focused window.

  • string:

    Window of the given module name

  • shape:

    A shape that defines the target window and the top-left position the x and y coordinates are relative to.

    A (shape)0 argument can be used as target to address the window which currently is the active popup or has the keyboard focus.

touchPoints

The mapping argument defines which touchPoints shall be given. A dyn_mapping is used for more than 1 point.

The following keys can be used in the mapping:

  • state(string): can be one of:
    • pressed
    • moved
    • stationary
    • released

    Defines the current state of the touchPoint. If not given, the function uses "stationary" as default.

  • id(int): The optional identifier for a touchPoint. This is needed when multiple points are used.
  • x(int), y(int): A point relative to given target. If not given (0, 0) is used.

Return value

Returns -1 if an error occurs and 0 if the function was executed successfully.

Errors

The specified module does not exist.

Description

The function sends a touch event to a target. It specifies the position the touch will be done at and its nature.

Assignment

Miscellaneous Functions

Availability

UI