Well, grabbing key codes from special characters gives different results on keyboards with different layouts. But what about "common" characters like az? If you have a QWERTY keyboard, you will get key code 81 when you type q . When you have an AZERTY keyboard, you get code 81 when you press a , since a where q should be? Or is another mapping performed?
EDIT:
The answer I accepted is probably the best solution when you grab the keys and want to be sure that βaβ is really βaβ, but as I explain in the comment below, I'm still curious how the key codes are βtranslatedβ when using the built-in keyboards. That is: sources suggest that at least az should be consistent, but I cannot find support for this (or the one who really tried).
source share