Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!THINK.COM!garyo From: garyo@THINK.COM (Gary Oberbrunner) Newsgroups: comp.windows.x Subject: Re: R4 xterm modmap strangeness Message-ID: <9001112348.AA17091@prometheus.think.com> Date: 11 Jan 90 23:48:54 GMT References: <9001112030.AA06475@expire.lcs.mit.edu> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 48 I ask: Why should I have to change the keysyms in my xmodmap just to change the modifier bits associated with some keys? Bob replies: Because of the way "Meta" is defined. It isn't defined by "a key that has Meta on it", it's defined by "a modifier bit that has an associated key that has Meta on it". For better or worse (the Xt spec is probably too liberal) the control modifier is included in this search, so it gets treated as both control and meta simultaneously. At least I think that's what's going on. I know it's just me, but I still don't fully get it. The Xt doc on this (finally found it!) says something like this: Meta is defined by "ANY (???) modifier bit whose corresponding keycode (what if there are >1?) contains the corresponding left or right keysym (Meta_L or Meta_R, I guess)." Isn't this extremely strange? Is my interpretation right? Was it really like this in R3? How does this work in practice (and where is it done in the source)? And why is this in the Xt spec anyway? Shouldn't this all be in the red book? I'd expect this stuff to be defined with XLookupString. No wonder I couldn't find it! Is this because I have two physical keys with the same keysym (Control_L)? Yes, xmodmap only adds the first key that it finds with the specified keysym, not all keys. You should have figured this out from the keycode values that xmodmap prints out (in parens). You'll have to stand on your head a bit to fix this; xmodmap is stupid and only accepts keysyms in the add command. You'll have to first label the key with some unique keysym, then do the add, then change the keysym to Control. Clearly here you're saying that the keysym is not used to look up the modifier bits at run time. This jibes with the Xt doc, which says that Shift, Lock and Control are treated specially - they just look at the modifier map, not the keysym. Why are they different? - Gary Oberbrunner Thinking Machines Corporation 245 First St Cambridge, MA 02142 garyo@think.com