LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to reduce the process time of function [GetGlobalMouseState ();]?

I use a function of

GetGlobalMouseState (NULL, &globalX, &globalY, &leftBtn, &rightBtn,
                             &keyStates);

to check the keystates in order to find out which is being pressed. however, after the program starts to run, this function starts to take more and more time to process, making the entire program slower.

how do i get rid of this time issue?

0 Kudos
Message 1 of 2
(3,134 Views)

Hello Appxeiod,

 

Consider looking at the example in CVI for reference. Are you using a timer callback function to poll the mouse state or are you constantly polling the mouse state in a while loop? Depending on how often you are polling the mouse state this might cause your program to run slower due to the process user events functions not being accessed as often.

Ian M.
National Instruments
0 Kudos
Message 2 of 2
(3,113 Views)