[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Please test Macintosh keyboards with xkb-data 0.8-12exp1

On Fri, Sep 08, 2006 at 12:08:10PM +0200, Michel Dänzer wrote:
> I'm not sure a model will cut it either. Here's my recollection of the
> problem:
> The hardware keycodes of these keys can be swapped, depending on layout
> and maybe other factors (IIRC it's about ISO vs. other variants of ADB
> keyboards). The kernel should detect this and always generate the same
> PC-style keycodes, but fails to do so in some cases. I think the
> keyboard type can be deferred from
> dmesg|grep 'adb devices'
> but I forget how exactly.

This indeed would explain why USB keyboards have swapped keycodes.

Here are more detailed informations for those who want to understand
what is discussed here.  Running
  setxkbmap -model macintosh -layout fr -print
displays (with xkb-data 0.8-12exp1)
  xkb_keymap {
        xkb_keycodes  { include "macintosh(macbook)+aliases(azerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc(pc105)+macintosh_vndr/fr+inet(apple)"       };
        xkb_geometry  { include "macintosh(macintosh)"  };
In this discussion, we are only interested in keycodes.
Now have a look at /usr/share/X11/xkb/rules/xorg
The line
  ! model         =       keycodes
tells that following lines will map model names to keycodes, in
  macintosh_old =       macintosh(old)
  macintosh_old2        =       macintosh
  macbook       =       macintosh(macbook)
  macintosh     =       macintosh(macbook)
 $macs          =       macintosh
The $macs variable is defined at the top of this file.  The right-hand
side refers to files under /usr/share/X11/xkb/keycodes.
When setting model to macintosh, setxkbmap adds macintosh(macbook) to
xkb_keycodes.  The aliases(azerty) part comes from
  ! layout        =       keycodes
    $azerty       =       +aliases(azerty)
    $qwertz       =       +aliases(qwertz)
    *             =       +aliases(qwerty)
but this is not important for us.

In unstable, there are 2 models: macintosh and macintosh_old.
The latter is for older kernels, and should probably be renamed into
macintosh_adb for clarity reasons.
Upstream received bug reports from MacBook users, complaining that
two keys were swapped.  A macbook model has been added, but my
feeling is that it is misnamed since most Mac keyboards will need
it, not only MacBooks.
I made an experiment with 0.8-12exp1, by setting all models to
macintosh(macbook) by default (well I forgot to also modify $macs,
this is a bug), and introduced macintosh_old2 for people who need
it.  In the next experimental version, I am considering using the
following rules:
  macintosh_adb =       macintosh(old)
  macintosh_alt =       macintosh
 $macs          =       macintosh(macbook)
As explained by Michel, no name can fit the plain macintosh from
unstable, so macintosh_alt (for 'alternative') may be an option.

> So maybe this should be handled via layout/variant/option.

I am afraid that this can hardly be done by layout or variant.  But
this is doable by an option, so we would have 2 models (ADB and PC)
and an option would swap 2 keys.  This is interesting, I will also
consider it.

> Don't take my word for it though; I haven't sacrificed any neurons on
> this for a couple of years, and my memory is fuzzy. I hope this will
> help someone else dig out more information though.

Just to be clear, I am not a kernel guy, so if someone can indeed
confirm your words, that would be great.


Reply to: