[comp.windows.x] KeySyms and KeyCodes

DAVIS@scrvx2.sdr.slb.COM (03/15/88)

having finally satisfied myself that there is no way in 10.4 to activate
a few of the Sun 3 keyboard function keys, I have resigned myself to awaiting
our decision to move to the new release. 

However, a fundamental question remains in my mind - what is the lowest
level in all this ? Is KeyCode x02020 or whatever what's actaully generated
when I press a given key on the keyboard, or is this yet another mapping
from a terminal dependent sequence to some defined table of KeyCodes ? 

This doesn't bother me too much, especially since I moved back to Suntools
given the instability of 10.4's windows on our Sun's (ie; resize, and if the
xterm cursor hangs around a moment too long, you *know* you've lost the
window!), but it would be nice to know - backgrarnd, lahk.....

Paul Davis
Schlumberger Cambridge Research,
England.

davis%m_scrvx2%sdr.slb.com@relay.csnet

RWS@zermatt.lcs.mit.EDU (Robert Scheifler) (03/15/88)

    Date: Tue, 15 Mar 88 05:00 EDT
    From: DAVIS%scrvx2.sdr.slb.com@relay.cs.net

    However, a fundamental question remains in my mind - what is the lowest
    level in all this ? Is KeyCode x02020 or whatever what's actaully generated
    when I press a given key on the keyboard, or is this yet another mapping
    from a terminal dependent sequence to some defined table of KeyCodes ? 

The (8-bit) keycode will typically be whatever the hardware or OS
generates, but there is no requirement for this; a server can use
absolutely any keycode values it wants to.  Keycodes are simply a data
compression mechanism; what matters is the keysyms that are (logically)
engraved on the keys.

DAVIS@scrvx2.sdr.slb.COM (03/15/88)

	Re: from RWS, 15 Mar 88 09:44

	... ; a server can use absolutely any keycode it wants to. Keycodes
	are simply a data compression mechanism; what matters is the keysyms
	that are (logically) bound to them ...

Well, not quite. I gather that X11 has completely rethought the basis of
the keymapping, but to give you an example of where it could matter, take
X10R4 - I wanted to map *all* the Sun function keys, but there are no
keycodes defined that correspond to a number of them. If I had some idea
of what the basis of the mapping between "press-this-key" and "ah! keycode
such-and-such", I could have put some new ones into the relevant .h file,
but such a basis was not clear to me (though I didn't try *too* hard..).
So long as there are sensible keysyms and there exist keycodes for all
keys on the terminal, then I agree, we should worry only about the logical
level, but when you have such a wierd terminal as Sun :-) that generates
outrageous sequences when you hit R13, well, then ther are problems.

Please note, I have seen the X11R1 doc., and it is clear to me that in X11,
all the function keys are defined at the keycode level, and labelled 
sensibly at the keysym level. I just would like to understand where the
keycodes come from, say specifically on the Sun ... OS or hardware ?? Then,
if it happens again, I might be able to fix it here...

thanks,

Paul D.