Sha256: 580f74db07d2c48e5ec650c1084c58887a2b6f6535cfc6937af32fc265f02ba3

Contents?: true

Size: 992 Bytes

Versions: 2

Compression:

Stored size: 992 Bytes

Contents

module ScreenDriver
  class Mouse

    def mouse_move(x, y)
      mouse = Robot.new
      mouse.mouseMove(x, y)
    end

    def left_click(x, y)
      mouse = Robot.new
      mouse.mouseMove(x,y)
      mouse.mousePress(InputEvent::BUTTON1_MASK);
      mouse.mouseRelease(InputEvent::BUTTON1_MASK);
      #Java 7+ Only
      #mouse.mousePress(InputEvent::BUTTON1_DOWN_MASK);
      #mouse.mouseRelease(InputEvent::BUTTON1_DOWN_MASK);
    end

    def double_click(x, y)
      mouse = Robot.new
      mouse.mouseMove(x, y)
      mouse.mousePress(InputEvent::BUTTON1_MASK);
      mouse.mouseRelease(InputEvent::BUTTON1_MASK);
      mouse.mousePress(InputEvent::BUTTON1_MASK);
      mouse.mouseRelease(InputEvent::BUTTON1_MASK);
      #Java 7+ Only
      #mouse.mousePress(InputEvent::BUTTON1_DOWN_MASK);
      #mouse.mouseRelease(InputEvent::BUTTON1_DOWN_MASK);
      #mouse.mousePress(InputEvent::BUTTON1_DOWN_MASK);
      #mouse.mouseRelease(InputEvent::BUTTON1_DOWN_MASK);
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
screen_driver-0.0.1 lib/driver/mouse.rb
screen_driver-0.0.0 lib/driver/mouse.rb