Ascii Equivalents for KeyUp/KeyDown events
lex at cc.gatech.edu
Fri Dec 1 20:58:43 UTC 2000
> > Having a potentially different codes for every keyboard seems too
> > extreme. It either means that each application must do its own
> > translation,
> No! 99.9% of applications should be able to do just fine with the
> Unicode standard mapped characters. Furthermore, some special keys (
> cursor, function ) could be mapped to codes that can be fitted into
> the 'private' Unicode range, which has been defined for exactly that
> sort of purpose (or translated to escape-sequences, or both).
Well, we basically agree -- the A key should generate the same result on
all platforms. The only question is what encoding to use. I think we
may as well use the XFree86 definitions, since they have been worked out
already and they've been used on a wide variety of keyboards. It's not
just the work of coming up with all the codes (XFree has about 1300).
It's the subsequent effort to check that the codes make sense on a
variety of keyboards.
The shift key issue doesn't seem real important, though in fact I do
support the distinction even if we do end up defining a new set of
codes. I'd like to pass in the distinction for the same reason I'd like
to see Fn keys passed in -- most keyboards have them, even if Squeak
software can't totally rely on them being prosent. But it's not that
important, anyway; most code is probably *not* going to react
differently to left-shift and right-shift, anyway.
In short, it seems like a lot of work to do a good job of defining a new
set of codes, and the X guys have already gone through that effort.
Maybe there are nits to pick with it, but it seems like a fine set of
codes to at least start with.
More information about the Squeak-dev