Dieser liebe Herr (Herr könnte in diesem Fall auch rein theoretisch eine weibliche Person bezeichnen. Ich habe keine Ahnung) hier hat es geschrieben:
Code:
#==================================================================
# GMUS Guedez Mouse Use System
# Version: 1.0
# Released: 26/5/2006 Last Update: 1/6/2006
# Thx to: Cadafalso, Near Fantastica, and some guys from asylum!
# EDITED BY TSUNOKIETTE (to get neccesary parts only)
#==================================================================
und es sieht wie folgt aus:
Code:
$getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
class Mouse_Coordinates
attr_reader :x
attr_reader :y
def initialize
@x = get_pos('x')
@y = get_pos('y')
end
def update
@x = get_pos('x')
@y = get_pos('y')
end
def get_pos(coord_type)
lpPoint = " " * 8 # store two LONGs
$getCursorPos.Call(lpPoint)
x,y = lpPoint.unpack("LL") # get the actual values
if coord_type == 'x'
return x
elsif coord_type == 'y'
return y
end
end
end