Introducing rubyxmacro

Installation

Usage

Create a display:

require 'rubyxmacro'
d = RubyXMacro::Display.new

Move the mouse:

d.moveMouse(100,100)

Click the mouse:

d.click
d.rightClick

Type a string of keys:

d.sendKeys('Hello World!')

Other methods:

d.mouseDown      #press and hold the mouse button down until mouseUp
d.mouseUp        #release the mouse button
d.rightMouseDown #press and hold the right mouse button down until rightMouseUp
d.rightMouseUp   #release the right mouse button

d.keyPress                      #press a key, only supports letters and numerals
d.keycodePress(keycodeNum)      #press a key based on it's keycode
d.keycodeShiftPress(keycodeNum) #hold down shift, then press key
d.keycodeDown(keycodeNum)       #press and hold down key with the specified keycode
d.keycodeUp(keycodeNum)         #release the key with the specified keycode

Note: The method names are in CamelCase which isn't in keeping with the Ruby convention.

Resources

Tags:
Source:
1710hrs.txt
Published:
13-04-2014 17:10