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.cr

Instance Method Summary

Instance Method Detail

def get_cursor_pos(point : Bytes) : Int32 #

Get current cursor position

  • point: Byte buffer to store the position (8 bytes for x,y coordinates) Returns: 1 on success, 0 on failure

[View source]
def get_double_click_time : UInt32 #

Get system double-click time (milliseconds)


[View source]
def get_key_state(virt_key : Int32) : Int16 #

Get the state of a virtual key

  • virt_key: Virtual key code Returns: Key state (negative if pressed, positive if toggled on)

[View source]
def get_system_metrics(index : Int32) : Int32 #

Get system metrics

  • index: System metric index (0=screen width, 1=screen height) Returns: The requested system metric value

[View source]
def send_input(count : UInt32, inputs : Bytes, input_size : Int32) : UInt32 #

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

[View source]
def send_input(inputs : Bytes, count : UInt32, input_size : Int32) : UInt32 #

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


[View source]
def set_cursor_pos(x : Int32, y : Int32) : Int32 #

Set cursor position

  • x: X coordinate in pixels
  • y: Y coordinate in pixels Returns: 1 on success, 0 on failure

[View source]