How to use mouse location?

Post Reply
creart
Posts: 59
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

How to use mouse location?

Post by creart »

Hi

I should be able to use:
Point p = MouseInfo.getPointerInfo().getLocation();
and then p.x or p.y to get the mouse coordinate on screen...
If I test this and feed the p.x value into a counter for instance or use the value on a string it doesn't show anything actually...
Any suggestions on what I'm doing wrong?

cheers Hans
Request for Music
creart
Posts: 59
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: How to use mouse location?

Post by creart »

I didn't even need to have the mouse location itself but needed a location within an object... and by combining the GetTooltip possibility, that's aware of which object you hover over, and MouseMove for which I found some info in Arbux's experiments, I am now able to do what I want :-)
Request for Music
ColinP
Posts: 1002
Joined: Mon Aug 03, 2020 7:46 pm

Re: How to use mouse location?

Post by ColinP »

I'm not exactly sure what you are trying to do but the usual method for responding to mouse movement is to handle Object_MouseMove events in Notify().
creart
Posts: 59
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: How to use mouse location?

Post by creart »

I know that Colin, thanks, but I actually wanted to be able to have mouse location anywhere within the module, not just over an object..
But I managed to solve what I wanted in an other way and did indeed use object_mousemove in combination with gettooltip because that knows which object you’re hovering over...
Request for Music
Post Reply

Return to “Module Designer”