module AutoClick::Mouse

Overview

Mouse operations for AutoClick

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

Extended Modules

Direct including types

Defined in:

auto_click/mouse.cr

Instance Method Summary

Instance Method Detail

def 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)

[View source]
def double_click : Nil #

Perform a double click


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

Double click at specific coordinates

  • x: X coordinate
  • y: Y coordinate

[View source]
def 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)

[View source]
def left_click : Nil #

Perform a left mouse button click


[View source]
def 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

[View source]
def middle_click : Nil #

Perform a middle mouse button click


[View source]
def 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

[View source]
def mouse_down(button_name : Symbol) : Nil #

Press and hold a mouse button

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

[View source]
def mouse_scroll(steps : Int32) : Nil #

Scroll the mouse wheel

  • steps: Number of scroll steps (positive = up/forward, negative = down/backward)

[View source]
def mouse_up(button_name : Symbol) : Nil #

Release a mouse button

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

[View source]
def right_click : Nil #

Perform a right mouse button click


[View source]
def 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

[View source]
def scroll_down(steps : Int32 = 1) : Nil #

Scroll down by specified steps

  • steps: Number of steps to scroll down (default: 1)

[View source]
def scroll_up(steps : Int32 = 1) : Nil #

Scroll up by specified steps

  • steps: Number of steps to scroll up (default: 1)

[View source]
def 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)

[View source]