07-22-2013 02:51 PM
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
07-30-2013 11:07 AM
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/
07-30-2013 11:12 AM - edited 07-30-2013 11:17 AM
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.
08-13-2013 09:13 AM
1. I tested it on two computers.
2. No error codes.
Chris
08-13-2013 09:17 AM
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