Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

GetAsyncKeyState and toAscii

Posted on 2009-05-14
3
Medium Priority
?
608 Views
Last Modified: 2013-12-03
Hi,

I'm wondering if it is possible to use GetAsyncKeyState and then translate it from a virtual key code to an ascii character as GetAsyncKeyState cannot easily differentiate between upper and lower case? If so, would somebody be kind enough to point me to an example?

Thank you,
Uni
0
Comment
Question by:Unimatrix_001
[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
3 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 1000 total points
ID: 24386173
Hi Unimatrix_001,

since GetAsyncKeyState only returns state for a single key the only way to do this is to test if any of the SHIFT key's state is 'pressed' too. Further maybe even you'd have to test if ALT/ALTGR is pressed to in order to identify special characters.

Unfortunately I don't know if you can use GetAsyncKeyState even to find out if CAPS_LOCK is on, so you'll have to test it. If it's not possible I think the only way to find out if it's a upper- or lower-case you have to use GetKeyboardState ...

ZOPPO
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 1000 total points
ID: 24386264
You could use 'GetKeyNameText()' (http://msdn.microsoft.com/en-us/library/ms646300.aspx) or 'MapVirtualKey()' (http://msdn.microsoft.com/en-us/library/ms646306.aspx) for that, depending on what you need.
0
 
LVL 3

Author Closing Comment

by:Unimatrix_001
ID: 31581504
Thank you. :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

609 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