0

Am using TJvUltimGrid, when pressing either the up or down arrow, to move from one record to the next, the event fires every other press. Does anyone have any ideas why it does not fire on every press and what I can do to fix it?

The dataset is a TADODataSet. The onKeyDown fires on every press.

REF: Delphi 2010 with Jedi JVCL Version 3.39, Windows XP

Doug
  • 1
  • 2
  • 2
    `OnKeyDown` and `OnKeyPress` have the same signature? Normally, OnKeyPress has a `Char` parameter and you cannot use it for arrow keys. Don't know about `TJvUltimGrid` though. – jpfollenius Nov 06 '09 at 16:03
  • It is my understanding that the onKeyDown and onKeyUp have the same signature. However, that is not what is happening. – Doug Nov 08 '09 at 18:06

1 Answers1

0

As Smasher said, the OnKeyPress event only is only fired for keys with a ASCII char. To respond to the arrow keys you need to use OnKeyDown or OnKeyUp .

Here is a quote from the online help.

The Key parameter in the OnKeyPress event handler is of type Char; therefore, the OnKeyPress event registers the ASCII character of the key pressed. Keys that don't correspond to an ASCII Char value (Shift or F1, for example) don't generate an OnKeyPress event.

Reference: OnKeyPress

stukelly
  • 4,187
  • 3
  • 35
  • 44
  • Thank you for your response. The key events onKeyPress and onKeyDown are working correctly. It is the onKeyUp that is not working as described in the documentation. It is the OnKeyUp that is skipping ever other row in the TJvUltimGrid. – Doug Nov 08 '09 at 18:04