module

AutoClick::Mouse

Mouse operations for AutoClick

This module provides all mouse-related functionality including clicking, dragging, scrolling, and cursor movement.

Instance methods

click_at(x : Int32, y : Int32, button : Symbol = :left) : Nil

Click at specific coordinates

  • x: X coordinate
  • y: Y coordinate
  • button: Mouse button to click (:left, :right, :middle)
Source
double_click(interval : Float64 | Nil = nil) : Nil

Perform a double click

  • interval: seconds to wait between the two clicks. If nil, a heuristic based on system double-click time (50% of it) is used. Default: nil
Source
double_click_at(x : Int32, y : Int32, interval : Float64 | Nil = nil) : Nil

Double click at specific coordinates

  • x: X coordinate
  • y: Y coordinate
Source
drag(sx : Int32, sy : Int32, ex : Int32, ey : Int32, button : Symbol = :left) : Nil

Drag from one point to another with specified button

  • sx: Start X coordinate
  • sy: Start Y coordinate
  • ex: End X coordinate
  • ey: End Y coordinate
  • button: Mouse button to use for dragging (:left, :right)
Source
left_click

Perform a left mouse button click

Source
left_drag(sx : Int32, sy : Int32, ex : Int32, ey : Int32) : Nil

Perform a left mouse drag operation

  • sx: Start X coordinate
  • sy: Start Y coordinate
  • ex: End X coordinate
  • ey: End Y coordinate
Source
middle_click

Perform a middle mouse button click

Source
mouse_button_pressed?(button : Symbol) : Bool

Check if mouse button is currently pressed

  • button: Mouse button to check (:left, :right, :middle) Returns: true if button is pressed, false otherwise
Source
mouse_down(button_name : Symbol) : Nil

Press and hold a mouse button

  • button_name: :left, :right, or :middle
Source
mouse_scroll(steps : Int32) : Nil

Scroll the mouse wheel

  • steps: Logical scroll steps. Positive => scroll up (wheel forward, Windows WHEEL_DELTA +120 per step) Negative => scroll down (wheel backward, Windows WHEEL_DELTA -120 per step) NOTE: A single Windows wheel detent is 120 units (WHEEL_DELTA). We multiply steps by 120.
Source
mouse_up(button_name : Symbol) : Nil

Release a mouse button

  • button_name: :left, :right, or :middle
Source
right_click

Perform a right mouse button click

Source
right_drag(sx : Int32, sy : Int32, ex : Int32, ey : Int32) : Nil

Perform a right mouse drag operation

  • sx: Start X coordinate
  • sy: Start Y coordinate
  • ex: End X coordinate
  • ey: End Y coordinate
Source
scroll_down(steps : Int32 = 1) : Nil

Scroll down by specified steps

  • steps: Number of steps to scroll down (default: 1)
Source
scroll_up(steps : Int32 = 1) : Nil

Scroll up by specified steps

  • steps: Number of steps to scroll up (default: 1)
Source
smooth_move(x : Int32, y : Int32, steps : Int32 = 10, delay : Float64 = 0.01) : Nil

Move mouse in a smooth motion (with intermediate steps)

  • x: Target X coordinate
  • y: Target Y coordinate
  • steps: Number of intermediate steps (default: 10)
  • delay: Delay between steps in seconds (default: 0.01)
Source