LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GetRelativeMouseState function

Hi,

The function GetRelativeMouseState suppose to return keyModifiers values. It works for SHIFT and CTRL keys but not for ALT (although the function description in the help file says that it should). Any reason why ALT key pressed is not detected? I am using LabWindows/CVI 2009 on Windows XP SP3.

Chris-o

 

0 Kudos
Message 1 of 5
(3,672 Views)

Have you tried to use another computer, and see if it works in another one?

Does it return any errors? http://zone.ni.com/reference/en-XX/help/370051P-01/cvi/uiref/cvierror_conditions/

National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(3,632 Views)

This is because the help is incorrect: VAL_UNDERLINE_MODIFIER, i.e. the <Alt> key, does not work.

 

You have to use the Windows function GetKeyboardState (provided you have the FDS of CVI).

 

        BYTE keys [ 256 ];

    GetKeyboardState ( keys );
    if ( keys [ VK_MENU ] & 0xF0 )
    {
    ;      // ALT or ALtGr has been pressed
    }

You can find more about this function here.

 

 

0 Kudos
Message 3 of 5
(3,631 Views)

1. I tested it on two computers.

2. No error codes.

 

Chris

0 Kudos
Message 4 of 5
(3,566 Views)

Thanks a lot for your suggestion. I have LabWindows/CVI 2009 Basic, but I believe that your method should also work in such environment (didin't have a chance to test it yet).

 

Chris

0 Kudos
Message 5 of 5
(3,565 Views)