left and right Ctrl/Alt/Shift - Key
I've got a problem:
I want to write a procedure which detects the key pressed by the user. So far
so good, but I want to know if it was the right or left (Ctrl, Shift, Alt) -
Key.
I have searched in the Help Files for the virtual Keys, and found:
vKey
Specifies one of 256 possible virtual-key codes.
Windows NT: You can use left- and right-distinguishing constants to specify
certain keys. See the Remarks section for further information.
Windows 95: Windows 95 does not support the left- and right-distinguishing
constants available on Windows NT.
I am working with D2 and Win95, is there an other possibility to seperate the
two Ctrl, Shift and Alt keys? Can anybody help me?? Eventually with an short
Code example like:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case Key of
VK_Left: showmessage('left');
VK_Right: showmessage('right');
VK_F10: showmessage('F10');
VK_TAB: showmessage('Tab');
VK_SHIFT: showmessage('Shift');
VK_CONTROL: showmessage('CONTROL');
VK_RCONTROL: showmessage('VK_RCONTROL'); // that does not work in
Win 95!!
VK_LSHIFT: showmessage('VK_LSHIF'); // that does not work in Win
95!!
VK_RSHIFT: showmessage('VK_RSHIFT'); // that does not work in Win
95!!
end;
end;
Thank you very much.
Martin.