module
AutoClick::User32
Overview
Windows User32 API bindings for AutoClick
This module provides Crystal bindings for the Windows User32.dll functions needed for mouse and keyboard automation.
Extended Modules
Defined in:
auto_click/user32.crInstance Method Summary
-
#get_cursor_pos(point : Bytes) : Int32
Get current cursor position
-
#get_double_click_time : UInt32
Get system double-click time (milliseconds)
-
#get_key_state(virt_key : Int32) : Int16
Get the state of a virtual key
-
#get_system_metrics(index : Int32) : Int32
Get system metrics
-
#send_input(count : UInt32, inputs : Bytes, input_size : Int32) : UInt32
Send input events to the system
-
#send_input(inputs : Bytes, count : UInt32, input_size : Int32) : UInt32
Deprecated legacy parameter order kept for backward compatibility.
DEPRECATED Use send_input(count, inputs, input_size) matching WinAPI order
-
#set_cursor_pos(x : Int32, y : Int32) : Int32
Set cursor position
Instance Method Detail
Get current cursor position
- point: Byte buffer to store the position (8 bytes for x,y coordinates) Returns: 1 on success, 0 on failure
Get the state of a virtual key
- virt_key: Virtual key code Returns: Key state (negative if pressed, positive if toggled on)
Get system metrics
- index: System metric index (0=screen width, 1=screen height) Returns: The requested system metric value
Send input events to the system
New canonical order matching WinAPI: UINT SendInput(UINT cInputs, LPINPUT pInputs, int cbSize);
- count: Number of INPUT structures
- inputs: Concatenated INPUT structure bytes
- input_size: Size of a single INPUT structure Returns: Number of events successfully inserted into the input stream
Deprecated legacy parameter order kept for backward compatibility. Will be removed in a future minor release.
DEPRECATED Use send_input(count, inputs, input_size) matching WinAPI order
Set cursor position
- x: X coordinate in pixels
- y: Y coordinate in pixels Returns: 1 on success, 0 on failure