Solved

Key parameter in OnKeyUp is wrong

Posted on 2002-06-24
5
776 Views
Last Modified: 2012-05-04
In a delphi OnKeyUp event, when I press the ';' on the keyboard the 'Key' parameter is set as 186 which corresponds to the character: 'º'. I have also noticed discrepencies with the ',' key. What's going on and how can I get find out accurately which key has been pressed?
0
Comment
Question by:Siband
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7103663
i guess that could
depend on the keyboardlayout- and/or countrysetting
of the os

do you have a special keyboardlayout and/or country setting?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7103689
next guess :-)

subtract just 127 from your value,
there may a flag set (bit 8?),
don't know the meaning at the moment
0
 

Author Comment

by:Siband
ID: 7103730
Subtracting 127 works for the ';' key but it doesn't work for the ',' key. A comma should be 44 but the value of Key is 188 in this case! I am not using a special keyboard as far as I know and my windows keyboard setting is 'English (United Kingdom)' which is correct.
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 50 total points
ID: 7103886
This is the Scancode not the ASCII-Key. You will have to compare to the VK_ constants. They only correspond with ASCII for the alphanumeric keys.
0
 

Author Comment

by:Siband
ID: 7104019
Thanks, That cirtainly answered the question. I have only given a B grading because I still don't know where to find a comprehensive list of the VK_ constants. I had to poke around to find a few in the Windows.pas file but it was cirtainly not comprehensive and didn't contain the ones for ';' and ','. I thank you for pointing me in the right direction however.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question