alt.setCursorPos

Used to forcefully set the cursor position on screen.

Declaration

alt.setCursorPos(pos: { x: number, y: number }): void

Usage

alt.setCursorPos({ x: 960, y: 540 });

Real World Example

Sets the cursor position in the top left of a screen.

alt.setCursorPos({ x: 0, y: 0 });

Sets the cursor position in the center of the screen.

const [_nothing, _x, _y] = native.getActiveScreenResolution(0, 0);
alt.setCursorPos({ x: _x / 2, y: _y / 2 });

Sets the cursor position in the bottom right of the screen.

const [_nothing, _x, _y] = native.getActiveScreenResolution(0, 0);
alt.setCursorPos({ x: _x, y: _y });

These examples assume you have imported alt from alt-client.

results matching ""

    No results matching ""