class RuMouse
Public Instance Methods
click(x, y, button = 1, n = 1)
click to toggle source
# File lib/rumouse.rb, line 12 def click x, y, button = 1, n = 1 n.times do press x, y, button release x, y, button end end
move(x, y)
click to toggle source
# File lib/rumouse.rb, line 19 def move x, y raise NotImplementedError end
position()
click to toggle source
# File lib/rumouse.rb, line 23 def position raise NotImplementedError end
press(x, y, button = 1)
click to toggle source
# File lib/rumouse.rb, line 4 def press x, y, button = 1 raise NotImplementedError end
release(x, y, button = 1)
click to toggle source
# File lib/rumouse.rb, line 8 def release x, y, button = 1 raise NotImplementedError end
screen_size()
click to toggle source
# File lib/rumouse.rb, line 27 def screen_size raise NotImplementedError end
Private Instance Methods
mouse_event(x, y, type, button)
click to toggle source
# File lib/rumouse/darwin.rb, line 94 def mouse_event x, y, type, button coord = CGEvent::CGPoint.new coord[:x] = x coord[:y] = y event = CGEvent::CGEventCreateMouseEvent(nil, type, coord, button) CGEvent::CGEventPost(:kCGHIDEventTap, event) CGEvent::CFRelease(event) end