Thomas wrote:
Huh? Did you perhaps misunderstand me?
Yep. I was responding to your individual points, but I guess I didn't know where you were going with them. Having a concrete example helps.
I do not want to check at all. I want to tell the user to press a certain k= ey of which I know the location (and scan code). To be able to tell him which key I mean, I have to know what's the character that's printed on his keyboard. That's what I need the mapping for.
Then just use Keyboard.Keyname, as Joe suggested. Maps keycodes to names. Happens to crash in RB 5.5, but that's been fixed.
And that's quite a common need for games, for instance. In a game, you might want to offer a 8-direction set of keys for 2-dimensional movement. E.g, consider you want to use the (english) keys: q w e a . d z x c Now, consider you want to tell the user to press the "z" key for "down left= ". But what if the user has a German keyboard? Then you'd have to tell him to press the "y" key instead. And to figure that out, you need a way to map scan codes to character codes of the local keyboard.
If this is your goal, why not simply let the user define the direction keys themselves? Most games do. That's dead simple to do and Joe's suggestion to use Keyboard.Keyname fits right in. For internationalization, you can have canned sets of default keycodes for each keyboard layout. If a user has a keyboard layout you haven't anticipated (e.g. a keyboard in which key code are not arranged where you think they are), no big deal, since they can customize the keys themselves.
Eric Baumgartner Inquirium _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
