Jason, > I am using D7 and trying to catch keys on Key Down. > > But my zero from the Num Pad returns a key value of 96 instead of 48. > OnKeyPress returns the correct value though...
You have hit on the difference between OnKeyDown and OnKeyPress. OnKeyDown just tells you which key the user has pressed, without interpreting that key. In other words, whether or not the Shift, Control or Alt key is currently depressed, and the state of the NumLock light, are all ignored. OnKeyPress tells you the interpreted key. So, OnKeyDown is telling you *which* zero key is being pressed, while OnKeyPress is telling you that *a* zero key is pressed. Choose your event based on what you need. If you really need OnKeyDown to tell you that *a* zero key is being pressed, you would need to do the interpreting yourself (shift keys, NumLock light). Rory Daulton [EMAIL PROTECTED] ------------------------------------------------------------------------------- [This e-mail scanned for viruses and spam by Nmax - "Your MAXimum Connection!"] ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

