Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 732 Bytes

README.md

File metadata and controls

52 lines (34 loc) · 732 Bytes

RuMouse

Gem Version

This is port of PyMouse to ruby. Cross-platform library to simulate mouse events.

Installation

Simply run:

$ gem install rumouse

or add to your Gemfile:

gem 'rumouse'

Requirements

On Linux, you must have libXtst, e.g., apt install libxtst-dev.

Usage

require 'rumouse'

mouse = RuMouse.new

# click at 10x10
mouse.click 10, 10

# move mouse to 100x100
mouse.move 100, 100

# press to drag at 10x10
mouse.press 10, 10

# release to drop at 100x100
mouse.release 100, 100

# get current position
puts mouse.position

# get screen size
puts mouse.screen_size