Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Miniwindows ➜ Current mouse position

Current mouse position

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Twisol   USA  (2,257 posts)  Bio
Date Sat 19 Dec 2009 10:50 PM (UTC)

Amended on Sat 19 Dec 2009 11:09 PM (UTC) by Twisol

Message
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.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 20 Dec 2009 12:39 AM (UTC)

Amended on Sun 20 Dec 2009 12:40 AM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #2 on Sun 20 Dec 2009 12:48 AM (UTC)
Message
Awesome, thank you!

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,197 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.