The only difference between your proposal and mine that I can
see is
that with your proposal, codes may conflict with assigned Unicode codes, whereas with mine they cannot.
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 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.
Marcel