pickzy.com

C  |  C++  |  Objective-C  |  VC++  |  Win32  |  MFC  |  Java  |  Php  |  Delphi  |  Visual Basic  |  .Net  |  Networking  |  General  |  Games  |  Jobs  |  Javascript  |  




Menu

pickSourcecode.com


        

 




 

Delphi > Programs

 

Delphi - Enter key or Return key? in delphi

Here's how to differentiate between the user pressing the ENTER (return) 
key on the standard keyboard and the ENTER key on the numeric keypad.

~~~~~~~~~~~~~~~~~~~~~~~~~
interface
... private
procedure WMKeyDown(var Message: TWMKeyDown) ; message CM_DIALOGKEY;

implementation
...
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;


//http://delphi.about.com/cs/adptips2004/a/bltip0104_3.htm

 
Privacy Policy | About Us