LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mouse enter and mouse leave not detected in small controls

Look at the attached VI. There is a thin boolean with mouse enter and mouse leave events which are not always detected when moving over the control quickly. I'm not sure whether this behavior originates from LV (7.0) or from the way XP handles the mouse movement, but I would definitely call this a bug in the sense that the mouse does "enter" and "leave" the control and the events are not fired.
 
My guess is that windows does not register all the points that mouse goes through, but only does so periodically. If it happens that 2 adjacent points are on 2 different sides of the control, LV can't recognize the enter and leave events. But that's just a guess.

___________________
Try to take over the world!
0 Kudos
Message 1 of 8
(4,753 Views)
Same thing happens on Mac OS X.

I suspect that the rate at which the OS reports the mouse position to the application is slow enough that rapid movements do not always get caught.

Maybe with a stack of contols and recording the presence of the mouse over each we could determine the speed of mouse detection?

Lynn
0 Kudos
Message 2 of 8
(4,739 Views)
This isn't really a bug.

It's because of the limited resolution of the detection of the mouse movement.  This is common to all OSes AFAIK.  Otherwise the computer would spend it's entire time listening to the mouse......

What would be interesting if one of the "gaming mouses" (mice?) on the market (1600 dpi) show a better real resolution when used for this......

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 3 of 8
(4,736 Views)
Here is a modified version with 6 booleans adjacent to each other. When I am quick with my trackball the cursor can cross all six without getting caught.

Lynn
0 Kudos
Message 4 of 8
(4,722 Views)
Shane, like I said - I consider this a bug because "if the mouse goes over the control it should fire a mouse enter event". I realize this is probably an OS issue which may not be fixable at NI's level, but maybe this is an LV bug, or if it isn't, maybe this should be placed into the documentation somewhere.

___________________
Try to take over the world!
0 Kudos
Message 5 of 8
(4,712 Views)

I put together a quick test, but I'm not sure what the results mean.

Lynn, one of the tests uses windows API (although you can run the other one).

Shane, sorry, only 7.1 on this PC.

Message Edited by tst on 07-12-2005 08:38 PM


___________________
Try to take over the world!
0 Kudos
Message 6 of 8
(4,700 Views)
I added a velocity calculation. At < 0.1 pixel/millisecond the coordinates display gets all the pixels. At speeds of 5-10 pixels/millisecond I can go over 100 pixels and about 13 milliseconds between readings.

I won't get a speeding ticket, will I?

Lynn
0 Kudos
Message 7 of 8
(4,691 Views)
Well, I still don't understand what the results mean, but at least I know I can move my mouse at an infinite velocity.Smiley Very Happy

___________________
Try to take over the world!
0 Kudos
Message 8 of 8
(4,684 Views)