Class: Wui::Mouse

Inherits:
Object
  • Object
show all
Defined in:
lib/wui.rb

Instance Method Summary collapse

Instance Method Details

#clickObject



91
92
93
94
95
96
# File 'lib/wui.rb', line 91

def click
  mouseEvent(0x0002) # MOUSEEVENTF_LEFTDOWN
  sleep 0.2
  mouseEvent(0x0004) # MOUSEEVENTF_LEFTUP
  self
end

#getPosObject



71
72
73
74
75
76
# File 'lib/wui.rb', line 71

def getPos
  lpP=" "*8
  Wui.GetCursorPos(lpP)
  xy = lpP.unpack("LL")
  {:x=> xy[0], :y=> xy[1]}
end

#move(dx, dy) ⇒ Object



86
87
88
89
# File 'lib/wui.rb', line 86

def move(dx, dy)
  easePos(dx, dy, false)
  self
end

#setPos(x, y) ⇒ Object Also known as: warp, to



78
79
80
81
# File 'lib/wui.rb', line 78

def setPos(x, y)
  Wui.SetCursorPos(x, y)
  self
end