Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Key parameter in OnKeyUp is wrong

Posted on 2002-06-24
5
Medium Priority
?
779 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 150 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

704 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