Subject: Re: Define X compose key
To: None <netbsd-help@NetBSD.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 05/02/2005 22:29:50
Geert Hendrickx wrote:
> > How do I define a compose key in X?  I have not defined a locale.  
> 
> The simplest way (and X-client independant) is to add 
> 
> Option "XkbOptions" "compose:menu" 
> 
> to this section: 
> 
> > Section "InputDevice"
> > 	Identifier  "Keyboard0"
> > 	Driver      "keyboard"
> > 	Option	    "XkbLayout"   "us_intl"
> > 	Option	    "XkbVariant"  "nodeadkeys"
> > EndSection
> 
> This turns the Windows "right click" button into the Compose key.  

Thank you for that.  

As it happens, I don't have a Windows key, because I found that keyboards
with one interfered with my use of Alt-tab.  I kept hitting the Windows
key instead....

Following your suggestion, I tried to find the equivalent syntax for using
Scroll-lock instead.  And I have to say, the documentation is pretty thin.
 "man keyboard" says Xkboptions "specifies the XKB keyboard option
components.  These can be used to enhance the keyboard behaviour."  OK. 
What is the domain of those options?  

May I rant?  

$ man xkb
man: no entry for xkb in the manual.
$ man Xkb
man: no entry for Xkb in the manual.
$ man -k xkb
setxkbmap (1) - set the keyboard using the X Keyboard Extension
xkbcomp (1) - compile XKB keyboard description
xkbevd (1) - XKB event daemon
xkbprint (1) - print an XKB keyboard description

Nothing of any use to me afaict.  Googling "xkb site:xfree86.org" of
course turns up http://www.xfree86.org/current/XKB-Config.html, not
exactly a reference manual, which says "The proper rules file depends on
your vendor. In reality, the commonest file of rules is xfree86."  Bah. 
Isn't XFree86 my "vendor"?  So I point my browser at
file:///usr/X11R6/lib/X11/xkb/ and wouldn't you know by the color of the
links I can tell I've been there before.  In fact, I find these lines in
file:///usr/X11R6/lib/X11/xkb/rules/xfree86.lst:

  compose:ralt		Right Alt is Compose
  compose:rwin		Right Win-key is Compose
  compose:menu		Menu is Compose

That limits me to Right Alt on my keyboard, not too attractive.  

If I understand that by-the-way note in the XKB Configuration Guide,
xfree86.lst is governing the domain of XkbOptions.  With a Ph.D. in XKB,
maybe xkbcomp(1) would let me create a my own .xkm extension.  Is this
really expected of mere mortals?  The Guide says no, "This method has been
obsoleted by previously described rules files which are far more flexible
and allow simpler and more intuitive syntax."  Erm, I didn't know if
picking one's own Compose key is considered obsolete these days....

I'm sure XKB is wonderful and I can see it gets us mostly out of the
keysym viewing business, and I know I may have missed something I
shouldn't have.  But afaict ye olde xmodmap(1) is the easiest way for a
humble user to set the Compose key to his liking.  In particular, he has
the the benefit of its very thorough documentation.  

But, please, if there's an easier/better way, I'm all ears.  

Regards, 

--jkl