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.crInstance Method Summary
-
#click_at(x : Int32, y : Int32, button : Symbol = :left) : Nil
Click at specific coordinates
-
#double_click : Nil
Perform a double click
-
#double_click_at(x : Int32, y : Int32) : Nil
Double click at specific coordinates
-
#drag(sx : Int32, sy : Int32, ex : Int32, ey : Int32, button : Symbol = :left) : Nil
Drag from one point to another with specified button
-
#left_click : Nil
Perform a left mouse button click
-
#left_drag(sx : Int32, sy : Int32, ex : Int32, ey : Int32) : Nil
Perform a left mouse drag operation
-
#middle_click : Nil
Perform a middle mouse button click
-
#mouse_button_pressed?(button : Symbol) : Bool
Check if mouse button is currently pressed
-
#mouse_down(button_name : Symbol) : Nil
Press and hold a mouse button
-
#mouse_scroll(steps : Int32) : Nil
Scroll the mouse wheel
-
#mouse_up(button_name : Symbol) : Nil
Release a mouse button
-
#right_click : Nil
Perform a right mouse button click
-
#right_drag(sx : Int32, sy : Int32, ex : Int32, ey : Int32) : Nil
Perform a right mouse drag operation
-
#scroll_down(steps : Int32 = 1) : Nil
Scroll down by specified steps
-
#scroll_up(steps : Int32 = 1) : Nil
Scroll up by specified steps
-
#smooth_move(x : Int32, y : Int32, steps : Int32 = 10, delay : Float64 = 0.01) : Nil
Move mouse in a smooth motion (with intermediate steps)
Instance Method Detail
Click at specific coordinates
- x: X coordinate
- y: Y coordinate
- button: Mouse button to click (:left, :right, :middle)
Double click at specific coordinates
- x: X coordinate
- y: Y coordinate
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)
Perform a left mouse drag operation
- sx: Start X coordinate
- sy: Start Y coordinate
- ex: End X coordinate
- ey: End Y coordinate
Check if mouse button is currently pressed
- button: Mouse button to check (:left, :right, :middle) Returns: true if button is pressed, false otherwise
Press and hold a mouse button
- button_name: :left, :right, or :middle
Scroll the mouse wheel
- steps: Number of scroll steps (positive = up/forward, negative = down/backward)
Release a mouse button
- button_name: :left, :right, or :middle
Perform a right mouse drag operation
- sx: Start X coordinate
- sy: Start Y coordinate
- ex: End X coordinate
- ey: End Y coordinate
Scroll down by specified steps
- steps: Number of steps to scroll down (default: 1)
Scroll up by specified steps
- steps: Number of steps to scroll up (default: 1)
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)