Recent

Author Topic: Get #13 Key at DbGrid  (Read 11916 times)

geanmyboy

  • Newbie
  • Posts: 4
Get #13 Key at DbGrid
« on: March 02, 2010, 07:43:44 pm »
Hello Guys, I'm still here pissing you off .. 8)

For now I need to get the #13 Key ( The Famous Enter ) At a Dbgrid. The Key #27 ( Esc ) I Can get, but Enter No. Probably there's something about the S.O Right ? Is there a Way do Trap the Key ?!

I'm using Windows Xp SP3 - With Lazarus 0.9.28-2 Beta.

Thanks Buddies

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2615
Re: Get #13 Key at DbGrid
« Reply #1 on: March 03, 2010, 10:08:11 am »
How and where did you test this ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

davesimplewear

  • Sr. Member
  • ****
  • Posts: 320
    • Davids Freeware
Re: Get #13 Key at DbGrid
« Reply #2 on: March 03, 2010, 11:20:10 am »
are you using the KeyPrees event to capture the keystroke?
All things considered insanity seems the best option

geanmyboy

  • Newbie
  • Posts: 4
Re: Get #13 Key at DbGrid
« Reply #3 on: March 03, 2010, 06:26:00 pm »
Here's the Deal :  :D

I have a form with a DbGrid that's used to search Records. I have a DbGrid ( Align : AlClient ) and a DataSource Linked, and with a Zquery doing the Heavy part with the Database.

I'm Migrating one of mine app to lazarus, to see if can I develop a version for Linux. The Problem is that in another Forms I can get the enter key ( #13),  only at this form that I cannot. Their uses are the same, and I i'm still guessing that the problem might be something with the DbGrid. I need the Option - RowSelect as True.

Yes, Im Using the event OnKeypress.

I'm Using Windows XP SP3 - With Lazarus 0.9.28-2 Beta.

paweld

  • Hero Member
  • *****
  • Posts: 1268
Re: Get #13 Key at DbGrid
« Reply #4 on: March 03, 2010, 09:32:12 pm »
DBGrid - event OnKeyDown:

Code: [Select]
if Key=13 then
  ShowMessage('return');

It works. Lazarus 0.9.28-2, Windows 7

Best regards
paweld
Best regards / Pozdrawiam
paweld

José Mejuto

  • Full Member
  • ***
  • Posts: 136
Re: Get #13 Key at DbGrid
« Reply #5 on: March 06, 2010, 11:02:56 pm »
DBGrid - event OnKeyDown:
Code: [Select]
if Key=13 then
  ShowMessage('return');
It works. Lazarus 0.9.28-2, Windows 7
Best regards
paweld

Hello,

It fails in the keypress event, not in KeyDown. I had found the problem and fixed it in my local copy. Now I must perform some checks that nothing has been broken in the process.

Bart

  • Hero Member
  • *****
  • Posts: 5469
    • Bart en Mariska's Webstek
Re: Get #13 Key at DbGrid
« Reply #6 on: March 06, 2010, 11:11:52 pm »
You'll post the fix on Mantis then?

Bart

José Mejuto

  • Full Member
  • ***
  • Posts: 136
Re: Get #13 Key at DbGrid
« Reply #7 on: March 10, 2010, 09:57:50 pm »
You'll post the fix on Mantis then?
Bart

Hello,

Yes it is there, but after talking with main grids developer I'll reconstruct it because there are some colateral effects which are non wanted, specially the TAB key handling. A refactoring in Grids and DBGrids should happend also to keep the same functionality with proper KeyPress events.

cysco

  • Newbie
  • Posts: 2
Re: Get #13 Key at DbGrid
« Reply #8 on: July 23, 2010, 03:11:55 pm »
Any solution yet?

 

TinyPortal © 2005-2018