>>Sergy,
>>I only want to detect if the shift key has been pressed by itself. Your sample is good to determine if I want SHIFT + U (UPPER"U") or SHIFT+F2. No other key combinations necessary. The VFP keypress will not detect a loan shift keypress. The keypress event on the VFP form will not fire if I only press shift.
>
>I do not think the keyboard sends a standalone code for a shift key. I think shift has to be followed by another key before it even gets to the computer.
Isshiftkeypressed.prg
LOCAL luretval
TRY
DECLARE SHORT GetKeyState IN WIN32API INTEGER nKeyCode
luretval=GetKeyState(16)<0
CATCH
luretval=.F.
ENDTRY
RETURN luretval
Frank Camp