首页  编辑  

小键盘的Enter和大键盘的Enter

Tags: /超级猛料/Hardware.硬件相关/键盘和鼠标/   Date Created:

{

The following code sample demonstrates differentiating

between these two ENTER keys:

}

procedure TForm1.WMKeyDown(var Message: TWMKeyDown);

begin

 inherited;

 case Message.CharCode of

   VK_RETURN: // ENTER pressed

     if (Message.KeyData and $1000000 <> 0) then

       // Test bit 24 of lParam

       ShowMessage('ENTER on numeric keypad')

     else

       ShowMessage('ENTER on Standard keyboard');

 end;

end;