On Thu, 30 Nov 2000, Marcel Weiher wrote:
Good point. OTOH, inventing new codes just for the fun of it might not be clever. If we want to distinguish between characters typed and keys pressed/released (which I think we should do anyway) couldn't we use Unicode for the characters and X key syms for the keys?
Well, yes. However, I am not sure if having a "standard but non-standard" key-code is of much use, since you neither can be sure that the current device actually has a key-code that your app is looking for, nor that all the keys your device has actually map to one of the X keycodes.
I think the keysym specs are extended when new keys bocome common. Like the Menu-key on Windows keyboards.
I would think that the key-code should be whatever the device actually delivers (device-specific), because only then do you have a safe 1:1 mapping, whereas the same event also carries the unicode character (sequence) that is equivalent.
But wouldn't it be better if, for example, the left shift key would produce the same key code on all platforms? The raw keyvalue (in my system an integer in the range 8-255, of which 105 are used because my keyboard has this many keys) might be useful for games, but you would have to have a special in-Squeak mapping for these codes ...
-- Bert