home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / windows / x / 15945 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  7.9 KB

  1. Xref: sparky comp.windows.x:15945 comp.windows.x.apps:894
  2. Newsgroups: comp.windows.x,comp.windows.x.apps
  3. Path: sparky!uunet!stanford.edu!lucid.com!karoshi!jwz
  4. From: Jamie Zawinski <jwz@lucid.com>
  5. Subject: Re: Attention Earthlings -- Cross-Vendor X11 Server Mess!
  6. In-Reply-To: bzs@ussr.std.com's message of Sun, 30 Aug 1992 09:35:53 GMT
  7. Message-ID: <JWZ.92Aug31160057@thalidomide.lucid.com>
  8. Lines: 147
  9. Sender: usenet@lucid.com
  10. Organization: Lucid, Inc., Menlo Park, CA
  11. References: <BZS.92Aug30043553@ussr.std.com>
  12. Date: Mon, 31 Aug 92 23:01:06 GMT
  13.  
  14. In article <BZS.92Aug30043553@ussr.std.com> bzs@ussr.std.com (Barry Shein) wrote:
  15. > Basically, the tool to use to investigate this is "xmodmap -pk". If
  16. > you run this on different platforms you will get wildly varying
  17. > results indicating wildly different understandings of what should be
  18. > there.
  19.  
  20. I don't think this is because anyone is confused, I think it's because
  21. it's simply not standardized at all.
  22.  
  23. > For example, XK_a and XK_A (and other alphabetics.)
  24. > My understanding of the spec says it's almost always wrong to have
  25. > both of these in your keysym table because most likely the key only
  26. > displays one of these (typically, XK_A).
  27.  
  28. My understanding of the spec says that both are legal, and have well-defined
  29. interpretations.  As far as I can tell, it doesn't say which is "right."
  30.  
  31. > HOWEVER, which is right in some larger sense?
  32. > I don't know, consider a case like XK_equal (=) and XK_plus (+).
  33.  
  34. I'm not sure that it matters.  Consistency would be nice, but I don't think
  35. one way is necessarily better than the other.  I also haven't found it a 
  36. problem that different vendors do differen  things w.r.t. XK_A and XK_a.
  37.  
  38. > But, for example, if as I understand the spec, that only one of XK_A
  39. > or XK_a (usually XK_A) should (usually) be in the table as some
  40. > vendors believe, how do I ever discover that there is another shifted
  41. > or unshifted keycode also generated by that key (typically the
  42. > unshifted is missing)?
  43.  
  44. The rules that XLookupString follows for case-conversion and caps-lock
  45. and shift-lock processing are really hairy, but I think it's well-defined
  46. enough that there's no ambiguity.
  47.  
  48. > Consider, as a practical example, the Keycaps DA on a Macintosh.
  49. > How would you write it (portably) under these circumstances?
  50. >
  51. > I don't believe that program can be written even barely portably in
  52. > X11 (and lo as far as I know nothing like it exists, nicht wahr?)
  53.  
  54. Now we come to the heart of the matter.  First of all, I have implemented
  55. this.  You can get it from export.lcs.mit.edu: contrib/xkeycaps.tar.Z.
  56.  
  57. I agree with you that the X keyboard model is a mess, but not for the
  58. reason you mentioned.  The current system of querying the server to find
  59. out what keysyms are generated by which keys is needlessly hairy and
  60. confusing, but I believe it *works*.
  61.  
  62. The problem is that there is a good deal of information that you simply 
  63. cannot get at. 
  64.  
  65.   -  There is no way to find out the physical layout of the keyboard,
  66.      or the spatial relationship of various keys.
  67.  
  68.   -  There is no way to find out the name/type of the keyboard hardware 
  69.      which is in use.
  70.  
  71.   -  There is no portable way to reset the keyboard to a default (known)
  72.      state.  The only way to do this is by knowing what kind of keyboard
  73.      hardware is in use (see above.)
  74.  
  75.   -  There is no way to find out what is actually printed on the surfaces of
  76.      the keys.  I think you were saying that you think that there should be
  77.      a direct correspondence between the set of keysyms which a keycode 
  78.      generates and the text printed on the surface.  I don't think this is a
  79.      good idea.  They are two different pieces of information, one of which
  80.      you can change and one of which you can't.  (And, in the current system,
  81.      one of which you can interrogate and one of which you can't.)
  82.  
  83. > (Forget the physical layout problem, that's beyond redemption in X11
  84. > right now, unless there's something I don't know about, amusingly OW3
  85. > puts the keysyms into the table in the order, right-left/top-bottom,
  86. > that they appear on the Sun Type-4 keyboard, but that's an exception
  87. > in my experience, would you rely on it? I wouldn't.)
  88.  
  89. The only keyboard-specific information that xkeycaps absolutely needs that X
  90. doesn't provide is data describing the physical shape of the various keyboards
  91. it knows about.  Displaying the current mapping of keycodes to keysyms,
  92. tracking the shift key, etc, can be accomplished with what the X server
  93. provides.
  94.  
  95. However, I wanted to have a command to reset the keyboard to the default
  96. state.  Since X doesn't give you any way to do this, so I also encoded the
  97. default configuration of the various keyboards into the xkeycaps data files.
  98.  
  99. > As an example, Openwindows-3 seems to claim it has an F16 key which it
  100. > clearly does not (although they may be referring to something on the
  101. > keypad or something, there's reason to it, just not disciplined
  102. > reason, there are other oddities in there as well, but I'm not picking
  103. > on Sun, it's just weird out there.)
  104.  
  105. Possibly the reason that there is no way to find out what type of keyboard
  106. hardware is in use (if we want to assign that much intentionality to it) is
  107. that, philosophically speaking, you shouldn't care, because the keysyms will
  108. be the same from keyboard to keyboard, only their physical position will
  109. change.  If you bind something to F1, then it will work on any keyboard with
  110. an F1 key.
  111.  
  112. Of course, whatever monster intellect was responsible for the Xsun server
  113. decided that F15 was a really good name for the key which is physically
  114. labeled both "Front" and "L5", so this notion breaks down pretty quickly.
  115. It's not clear that this is a botch in the X standard, but it is most
  116. certainly a botch.
  117.  
  118. The part of the X spec which was no doubt involved in this pinheaded decision
  119. was the part that says that one should combine keys with similar intent: if
  120. one keyboard calls it "Enter" and another calls it "Return", then this should
  121. be transparent to the application.  That's fine for keys which are obviously
  122. congruent in intent, but calling the "R1" key "F21" was just an incredibly
  123. stupid idea.  I can't imagine why anyone thought this was a good idea.
  124.  
  125. And of course, Sun and MIT can't even agree on what the default keymap
  126. should be for Sun's own keyboard hardware, so it's not enough to know what
  127. keyboard you have sitting on your desk, you also have to know whose server
  128. you're running.
  129.  
  130. And for those few vendor-defined keysyms that are actually useful, neither
  131. Sun, nor DEC, nor HP, nor MIT can agree on what the names of them are.  For a
  132. laugh, look at the XKeysymDB files shipped by various vendors.  MIT thinks
  133. that Sun uses the prefix "SunFA_".  Sun disagrees: they use the prefix
  134. "SunXK_FA_".  MIT thinks DEC's keysyms begin with "D".  Sun disagrees: they
  135. think that DEC's keysyms begin with "DXK_".  I don't know what DEC thinks.
  136. And so on for the various perumtations.  Nevermind the fact that the keysyms
  137. in question serve the same purpose regardless of the vendor.
  138.  
  139. Another really big win is that it's not possible to write an xmodmap script
  140. that can function without having special knowledge about either: what keyboard
  141. hardware you're using, or: its current state of mungedness.  Since there is no
  142. (standard) way to restore the keyboard to a default configuration (so that you
  143. can use xmodmap's "keysym" commands), and there is no way to know what
  144. keyboard hardware you're using (so that you can use xmodmap's "keycode"
  145. commands) you're just hosed.  This could be called a bug in xmodmap, but
  146. really it's a bug in the X spec, because the only way xmodmap could provide
  147. this functionality is by doing what xkeycaps does: have lots of special
  148. knowledge about the keyboard hardware in use.  The X server should provide
  149. this information, since it must HAVE it to function.  X simply gives no way
  150. to access it.
  151.  
  152. Basically, the whole X keyboard model is a complete mess.  It is as good as
  153. no standard at all, because to get anything done, you need to have hardware-
  154. and vendor-specific knowledge anyway.
  155.  
  156.     -- Jamie
  157.