Solved

Key parameter in OnKeyUp is wrong

Posted on 2002-06-24
5
777 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

623 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