procedure TForm1.WMKeyDown(var Message: TWMKey);
begin
inherited;
//判断按下
if ((message.KeyData) and ($2a shl 16))=($2a shl 16) then
showmessage('左 shift 按下')
else if ((message.KeyData) and ($36 shl 16))=($36 shl 16) then
showmessage('右 shift 按下');
判断shift,ctrl键是可以,但是是左是右我就不知了,以下是例子
iShift:=Getkeystate(vk_Shift);
iCaptial:=Getkeystate(vk_Capital);
iNumlock:=Getkeystate(vk_NumLock);
if (iShift and KeyPressMask)=KeyPressMask then
bShift:=True else bShift:=False;