DBGrid1KeyDown lazarus / 16-Databases ---------------------------------------------------------------------- vigor · 2008-04-01 15:37 I want to do something like: procedure TForm1.DBGrid1KeyDown(Sender: TObject; var Key: Word;   Shift: TShiftState); begin   if (key=vk_return) then // do something, for example:   showmessage('Enter'); end;   It si working in Delphi but in Lazarus  "vk_return" is wrong. What is good constant for this, and where I can find constants for other keys. I use Lazarus 0.924 and Linux Ubuntu ---------------------------------------------------------------------- vigor · 2008-04-01 16:53 Answer is: Include lclTypes unit in units section. Best regards to all of you (Now on forum are 841 unregistered and 14 registered users) ---------------------------------------------------------------------- bobix · 2008-05-06 10:55 Or if (key=13) then ... ---------------------------------------------------------------------- researcher · 2009-05-22 22:22 you can get all the key codes with this - showmessage('key is: '+inttostr(key)); just press each key, and remember the ones you need.