AutoClick::Mouse
Mouse operations for AutoClick
This module provides all mouse-related functionality including clicking, dragging, scrolling, and cursor movement.
Instance methods
Click at specific coordinates
- x: X coordinate
- y: Y coordinate
- button: Mouse button to click (:left, :right, :middle)
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
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: 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.
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)