Current mouse position

Posted by Twisol on Sat 19 Dec 2009 10:50 PM — 3 posts, 9,547 views.

USA #0
Is there a way to discern the current mouse position at any time, in output window-relative coordinates? I know that you can use WindowInfo options 17 and 18, but those are apparently only valid during dragging operations on a specific miniwindow.

EDIT: Specifically, if the mouse leaves a hotspot (cancelmouseover), I'd like to know which pixel specifically it moved to outside the hotspot.

EDIT 2: As an aside, it is extremely annoying to test hotspot-related functionality when WindowAddHotspot() is disallowed outside plugins.
Amended on Sat 19 Dec 2009 11:09 PM by Twisol
Australia Forum Administrator #1
Version 4.45 updates the values returned by WindowInfo (14) and WindowInfo (15) to reflect where the mouse is at the moment the mouseover is cancelled. You could use this to work out which side they exited from (the numbers might be negative). Because the mouse may move more than 1 pixel away, the figure returned is not necessarily exactly one pixel from the edge.


Also added GetInfo (283) and GetInfo (284) which show the position of the mouse, last time it moved, relative to the current world's output window. That is, it will only update when the mouse moves over the output window.
Amended on Sun 20 Dec 2009 12:40 AM by Nick Gammon
USA #2
Awesome, thank you!