Original Post
Been playing around with DirectInput lately, but there's one thing I'm wondering about. How does it deal with international keyboards? How do I detect which non-US keys are pressed? As far as I know, I get an array of 255 chars, each representing an actual key on the keyboard, rather than a virtual key or ascii value. Then there are macros defined to map the names of each key to the appropriate array index value (DIK_A, or DIK_SUBTRACT, for example.) But they're only defined for the characters available on a normal US keyboard. What if the user presses, say, Ø or ½ or another key that doesn't exist on US keyboards? Presumably one of the 255 entries in the array wil be set, but how do I know which key that actually refers to? I might want to show which key was pressed (maybe to show the current key bindings when you're configuring controls, or maybe a tutorial wants to display which key you should press to perform some new action) So how would you do that in DirectInput? How would I find out, when some arbitrary key is pressed, what it actually *means*? Of course, many games don't deal with the issue at all, and just uses the standard US keymapping, forcing international players to figure out that when the game tells you to hit ´, it actually means ½, and when it says to press @, you need to use " instead. That's what I'd like to avoid, if possible. ;)