How to use mouse location?

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

How to use mouse location?

Post by creart » Fri Mar 05, 2021 11:30 am

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

creart
Posts: 33
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: How to use mouse location?

Post by creart » Sun Mar 07, 2021 1:46 pm

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 :-)

ColinP
Posts: 85
Joined: Mon Aug 03, 2020 7:46 pm

Re: How to use mouse location?

Post by ColinP » Sun Mar 07, 2021 8:46 pm

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: 33
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: How to use mouse location?

Post by creart » Tue Mar 09, 2021 5:58 am

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

Post Reply