views:

20

answers:

1

I have found that the Windows VK_OEM_X values have a tendency to refer to different physical keys, which makes them useless for localization-agnostic game controls.

I am thinking about using scan codes directly by hard-coding them, but that is my last resort.

Is there any other way to reference the physical keys on a 101-key* keyboard using Windows?

edit I also have need to work with far-eastern keyboards, which have the extra buttons next to the space bar.

For example: If I want the '/' key in my source code, I could be referring to the '!' key on a French keyboard. I don't care about what is actually printed on the key itself, nor am I trying to convert key sequences to characters. I am just looking for a standard labeling system that does not require a massive library of scan codes for different keyboards, let alone detecting the type of keyboard being used.

+1  A: 

I don't think so. If anyone knows for sure, it is probably the author of this series.

Let the user's control the key bindings, default them for whatever 3 keyboards your users use most commonly, and prompt otherwise?

Doug McClean
That is indeed a very helpful series!I already had a programmable virtual keyboard in mind, which would allow users to select what keys correspond to which functions -- which would consequently allow me, the programmer, to map arbitrary internal functions to them as well, just as one would buttons on a dialog box.The character printed on the key is something I can ask the OS for. It seems to me, however, that the physical location is something I cannot.
i_photon