Difference between revisions of "Lua:mouse event"
Jump to navigation
Jump to search
m (Added CodeBox Template.) |
m (Syntax Highlighting.) |
||
| Line 36: | Line 36: | ||
===Example=== | ===Example=== | ||
| − | < | + | <syntaxhighlight lang="lua" line> |
setMousePos(659, 573) | setMousePos(659, 573) | ||
mouse_event(MOUSEEVENTF_LEFTDOWN) | mouse_event(MOUSEEVENTF_LEFTDOWN) | ||
sleep(20) | sleep(20) | ||
mouse_event(MOUSEEVENTF_LEFTUP) | mouse_event(MOUSEEVENTF_LEFTUP) | ||
| − | </ | + | </syntaxhighlight> |
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
{{KeyboardMouse}} | {{KeyboardMouse}} | ||
Latest revision as of 19:32, 25 June 2026
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]
1 setMousePos(659, 573)
2 mouse_event(MOUSEEVENTF_LEFTDOWN)
3 sleep(20)
4 mouse_event(MOUSEEVENTF_LEFTUP)