DInput - Scancode to Ascii
I''ve got a little problem converting the keyboard scancodes I get from DInput into ascii values:
In the beginning, I used an internal translation table system, with 4 tables (normal, shifted, capslock, caps-shifted). This worked fine, but some time ago I read about a WinAPI-function ToAscii() in this newsgroup.
Well, when DX8 came out I decided to finally update my DInput code.
I''m now using MapVirtualKey() together with ToAscii() which works fine. hen the user is pressing Shift, the ascii characters are translated into uppercase by using toupper() . There''s just one problem: The uppercase value of eg. ''1'' is still ''1'', while the user expects that
[Shift]+[1] will result in a ''!''
So, what is the right way to implement Shift and CapsLock-Keys into a DirectInput application ?
I don''t want to use a simple translation table, because the characters of shifted keys may differ in other languages (like [Shift]+[2] which is ''@'' on us keyboards and ''"'' on german keyboards), but I cannot imagine another way...
-Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement