Lua:mouse event

From Cheat Engine
Revision as of 00:00, 5 December 2025 by Leunsel (talk | contribs) (Added CodeBox Template.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
<> Function

function mouse_event(Flags, [dx, dy, Data, ExtraInfo]) : void

Calls the Windows API mouse_event directly for advanced mouse control. See the MSDN documentation for detailed information about the parameters.

Function Parameters[edit]

Parameter Type Description
Flags Integer Specifies various aspects of mouse motion and button clicks.
dx Integer (optional) The absolute x-coordinate or relative motion in pixels.
dy Integer (optional) The absolute y-coordinate or relative motion in pixels.
Data Integer (optional) Additional data, e.g., amount of wheel movement.
ExtraInfo Integer (optional) Application-defined extra information.

Returns[edit]

void — This function does not return a value.

Example[edit]

setMousePos(659, 573)
mouse_event(MOUSEEVENTF_LEFTDOWN)
sleep(20)
mouse_event(MOUSEEVENTF_LEFTUP)

See also[edit]

Lua
Script Engine

Related Functions[edit]

getMousePos
setMousePos
isKeyPressed
keyDown
keyUp
doKeyPress
mouse_event
setGlobalKeyPollInterval
setGlobalDelayBetweenHotkeyActivation