module

AutoClick

Inherits AutoClick::Keyboard < AutoClick::Mouse

AutoClick - Windows GUI automation library for Crystal

This library provides mouse and keyboard automation capabilities by interfacing with Windows User32 API functions.

Usage:

# Method 1: Include the module
include AutoClick
left_click()
mouse_move(100, 100)
input_text("Hello World")

# Method 2: Use as namespace
AutoClick.left_click
AutoClick.mouse_move(100, 100)
AutoClick.input_text("Hello World")

Constants

VERSION = {{ (`shards version /tmp/tmp.EMBKmP/src/src/auto_click`).chomp.stringify }}

Instance methods

cursor_position

Get current cursor position

Returns an array containing [x, y] coordinates

Source
mouse_move(x : Int32, y : Int32) : Nil

Move cursor to specified coordinates

  • x: X coordinate in pixels
  • y: Y coordinate in pixels
Source
mouse_move_percentage(x_percent : Float64, y_percent : Float64) : Nil

Move cursor using percentage of screen dimensions

  • x_percent: X position as percentage (0.0 to 1.0)
  • y_percent: Y position as percentage (0.0 to 1.0)
Source
screen_resolution

Get current screen resolution

Returns an array containing [width, height] in pixels

Source

Nested types