Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query regarding 'onKeypress' event and key values.

Status
Not open for further replies.

CHeighlund

Programmer
Jun 11, 2007
163
US
I am working with a program where I would like the user to be able to 'page through' sets of information. I was considering doing this with the onKeypress event for the form, since the information can be gridded out in a rough two-dimensional form; I'd planned to use a string grid for the information itself, and the keypresses would be used to isolate what cell should be looked at. (Assuming a starting screen of [1,1].)

What character values do the directional keys have? I know that the character for enter is #13 (carriage return), but I do not know what characters would map to the up, down, left, and right arrow keys. Would someone please point me in the direction of this information?
 
You would do better to use KeyDown instead, since KeyPress does not handle function keys. I believe you will want to check for VK_DOWN, VK_UP, VK_LEFT, and VK_RIGHT.

Dilbert is not a fictional cartoon. It is a documentary.
 
Doh ! One finally comes along I can answer and you beat me to it ! :)


Steve (Delphi 2007 & XP)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top