Is the following a correct ImportC?
NSMouseInRect(x.CGFloat,y.CGFloat, rx.CGFloat, ry.CGFloat, rw.CGFloat, rh.CGFloat, flipped)
Because it doesn't seem to work..
Code: Select all
ImportC ""
CGEventCreate(e)
CGEventGetLocation(e)
NSMouseInRect(x.CGFloat,y.CGFloat, rx.CGFloat, ry.CGFloat, rw.CGFloat, rh.CGFloat, flipped)
EndImport
Procedure GetScreenWithMouse()
Protected i, mouseLoc.CGPoint
Protected ev = CGEventCreate(0)
CGEventGetLocation(ev)
!movsd [p.v_mouseLoc], xmm0
!movsd [p.v_mouseLoc + 8], xmm1
Protected nssa = CocoaMessage(0, 0, "NSScreen screens")
Protected c = CocoaMessage(0, nssa, "count")
Protected frame.CGRect
While i < c
Protected nss = CocoaMessage(0, nssa, "objectAtIndex:", i)
CocoaMessage(@frame, nss, "frame")
Debug "" + frame\origin\x + "," + frame\origin\y + ":" + frame\size\width + "," + frame\size\height
If NSMouseInRect(mouseLoc\x, mouseLoc\y, frame\origin\x, frame\origin\y, frame\size\width, frame\size\height, #YES) ; or #NO
Debug "Found"
EndIf
i + 1
Wend
EndProcedure
GetScreenWithMouse()