Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucsd!sdd.hp.com!decwrl!deccrl!crltrx!zorch.crl.dec.com!jg From: jg@zorch.crl.dec.com (Jim Gettys) Newsgroups: comp.windows.x Subject: Re: keycodes Keywords: uniqueness of Message-ID: <5514@crltrx.crl.dec.com> Date: 7 Jun 90 16:03:50 GMT References: <36306@sequent.UUCP> Sender: news@crltrx.crl.dec.com Reply-To: jg@zorch.crl.dec.com (Jim Gettys) Distribution: usa Organization: DEC Cambridge Research Lab Lines: 36 Each key on the keyboard "should" have a unique keycode, but there is no guarantee. For example, on the DEC LK201 keyboard (designed long before X), you can't tell left shift from right; this is inherent in the hardware, and cannot be worked around. The LK401 which we recently started using on the VT1000 can. But you can't assume you can distinguish all keys, and there is no advantage for keycodes to be shared between keys. Keyboards should also always report up transitions properly, and my experience is that implementation of autorepeat is best left to driver software. Many keyboards attempt to be too "smart" for their own good, and end up getting in the way. So while X is designed presuming reasonable keyboards, it was not possible to require all keyboards conform at the time we were designing X. Another common problem is that some people's keyboards can't report up transitions on non-modifier keys at all times (or don't due to software limitations, like the current Ultrix drivers which can't do both autorepeat and up/down simultaneously; I've fixed this in the multi-screen driver which will start appearing later this year on our RISC machines). There may also be limitations on what keys can be modifiers (true again in current Ultrix software, and again fixed in my new driver, which works as well as the hardware can possibly be used, by telling the keyboard to do as little as possible for my "benefit"). In general, X asks for "correct" keyboards, but many currently on the market are inadaquate either due to hardware problems or driver problems, and so software implementers had better be more careful on keyboard usage than anywhere else in X. I use my own company's products only as an example; I have reason to believe that we are typical of what is on the market today (and we are fixing as many problems as possible). - Jim