Page 1 of 1

How to use mouse location?

Posted: Fri Mar 05, 2021 11:30 am
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

Re: How to use mouse location?

Posted: Sun Mar 07, 2021 1:46 pm
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 :-)

Re: How to use mouse location?

Posted: Sun Mar 07, 2021 8:46 pm
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().

Re: How to use mouse location?

Posted: Tue Mar 09, 2021 5:58 am
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...