I think this is a system-dependent task. You must provide your code with a way to download system-specific gems (AutoIt on Win, Automations on Linux). If you are targeting Mac OS, you can create your own lib by calling CGPostMouseEvent from CGRemoteOperation.h through the FFI library.
For instance:
'ffi' required
module Mouse extend FFI::Library ffi_lib '/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics' class CGPoint < FFI::Struct layout :x, :double, :y, :double end attach_function :CGPostMouseEvent, [ CGPoint, :bool, :int, :bool ], :void end point = Mouse::CGPoint.new point[:x] = 100 point[:y] = 100 Mouse::CGPostMouseEvent(point, true, 1, true)
source share