mousemoverel
Moves the mouse cursor by a relative offset.
function mousemoverel(x: number, y: number): ()Synopsis
How it works
Moves the mouse cursor by a relative offset from its current position. Uses
SendInput with relative mode (no MOUSEEVENTF_ABSOLUTE flag):
INPUT input = {};
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_MOVE; // relative mode
input.mi.dx = x; // pixel delta
input.mi.dy = y;
SendInput(1, &input, sizeof(INPUT));
In relative mode, dx/dy are pixel deltas. Positive x = right, positive y = down. Ideal for Roblox camera rotation where you need delta (mouse look) movement. The OS handles acceleration/pointer speed curves before moving the cursor.Usage
Nudge cursor right by 50px
mousemoverel(50, 0)Parameters
x number Horizontal pixel offset.
y number Vertical pixel offset.