I just finished configuring my keyboard to my full contentment, but it
involved a bit of hacking on which the experts out there might want to
comment. I'm quite a newbie concerning Linux, so I might have done some
things in a less-than-optimal way.

I want my keyboard (Swiss German layout, by the way) to behave as I'm used
to, i.e. as close to MacOS as possible. So I first switched to Mac keycodes,
following Sylvain Obegi's guide: dev.mac_hid.keyboard_sends_linux_keycodes=0
in /etc/sysctl.conf.

Then on to the console keymap: As there was no swiss german keymap in
/usr/lib/kbd/keymaps/mac/, I first used a german one (mac-de2-ext or
mac-de-latin1-nodeadkeys, can't remember), then one that I once had
downloaded somewhere and hand-tweaked that to suit my needs. Everything is
working fine now with that one, I can write special characters (among them
important ones like @, |, {}, #) like in MacOS using the Option key that I
mapped to AltGr, but there is one thing that I don't understand: At bootup
it displays

  Loading keymap: mac-de_CH-latin1             [  OK  ]
  Loading compose keys: compose.latin1.inc     [  OK  ]
  The BackSpace key sends: ^?                  [FAILED]

What does this "[FAILED]" mean? I always thought that thing about the
BackSpace key was an informational message only, how can this fail? This
happened with the the supplied mac keymaps too, but not when using Linux
keycodes.


Second, X keymap. Sylvain's guide says:

> in /etc/X11/XF86Config-4
> Option �XkbModel�
> pc105 (default) : Linux keycodes
> macintosh : mac keycodes
> 
> Option �XkbLayout�
> xx (default) : keymap for Linux keycodes
> macintosh/xx : keymap for mac keycodes (is it exists, see
> /etc/X11/xkb/symbols/macintosh/)

This is (in my opinion - but I don't understand that whole xkb system very
well) not entirely correct.

First, if you are using Linux keycodes, you can use "macintosh" as XkbModel
as well, because ...xkb/rules/xfree86 maps model "macintosh" to keycodes
"xfree86". (But this still doesn't give you a fully usable MacOS-like
keyboard, because the Mac keyboard has no AltGr key and thus you can't reach
the secondary characters. Also, the Command key doesn't seem to be mapped to
anything (but I couldn't verify this as I didn't have xev installed).)

Second, if you are using Mac keycodes, you should not use XkbModel
"macintosh", but "macintosh_old", because ...xkb/rules/xfree86 maps model
"macintosh" to keycodes "xfree86" (Linux keycodes) and "macintosh_old" to
keycodes "macintosh" (Mac keycodes).

Third, if you specify "macintosh/xx" as XkbLayout, the X server complains
about not finding "macintosh/macintosh/xx". You just have to use "xx"
because the "macintosh/" directoy part gets added automatically by
...xkb/rules/xfree86.

Except for those errors, Sylvain's guide was very helpful.

I made some changes to the supplied ..xkb/symbols/macintosh/de_CH as well to
make it as faithful as possible to the MacOS keyboard behavior. The most
important one is that the key that it calls <COIN> (the additional key on
european keyboards, Mac keycode 18, produces [section, degree] in swiss
german layout) is actually called <LSGT> (in the keycodes file and in all
other european symbol files).

 -Christian


Reply via email to