Monitoring Mouse Position in LabWindows/CVI Primary Software: LabWindows/CVI Development Systems>>Full Development SystemPrimary Software Version: 8.1 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: When a command button on the user interface is pressed and held down, I want some repetitive task to occur (i.e. a button controlling the volume of a stereo). In this situation, I need two pieces of information which are whether the mouse button is still down or not and whether the user has moved the mouse cursor outside the region of the button. How can I detect these mouse settings in LabWindows/CVI? Solution: In LabWindows/CVI you can use the GetGlobalMouseState() and GetRelativeMouseState() functions to attain the information mentioned above. The GetGlobalMouseState function returns the position of the mouse relative to the top, left corner of the screen. The GetRelativeMouseState function returns the position of the mouse relative to the top and left coordinates of a specific control. Both functions return information about the left and right mouse button state as well as whether a keyboard modifier was pressed.
You can also enable extended mouse events by using the EnableExtendedMouseEvents() function. This function enables a control to receive the following extended mouse events in addition to the built-in mouse events
LabWindows/CVI 8.1 made the Refer to the LabWindows/CVI Help for more information about built-in mouse events and the functions mentioned earlier.
Report Date: 12/18/1995 Last Updated: 12/29/2006 Document ID: 0GHA3UZL |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
