sendWheelEvent()

The function sends a mouse-wheel event to a target window.

Synopsis

int sendWheelEvent(string moduleName|shape target, int x = -1, int y = -1, int deltaAngle = 0, int modifiers = 0);

Parameters

Parameter Description
moduleName Name of the module.
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..

x, y

Mouse coordinates relative to the given target

Default is the current mouse position

deltaAngle

The relative amount that the wheel was rotated, in eighths of a degree. A positive value indicates that the wheel was rotated forwards away from the user; a negative value indicates that the wheel was rotated backwards toward the user.

Most mouse types work in steps of 15 degrees, in which case the delta value is a multiple of 120; i.e., 120 units * 1/8 = 15 degrees.

modifiers a combination of KEY_SHIFT, KEY_CONTROL, KEY_ALT, KEY_META

Return value

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

Errors

The specified module does not exist or the shape pointer is a null pointer.

Description

The function sends a mouse-wheel event to a target. It works similar to sendMouseEvent().

Assignment

Miscellaneous Functions

Availability

UI