Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 244824 - sys-kernel/gentoo-sources-2.6.25-r7 - Apple USB ISO keyboard has incorrectly swapped keys
Summary: sys-kernel/gentoo-sources-2.6.25-r7 - Apple USB ISO keyboard has incorrectly ...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
Whiteboard: watch-linux-bugzilla
Depends on:
Reported: 2008-10-28 21:22 UTC by Federico Ferri (RETIRED)
Modified: 2013-02-10 16:59 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Federico Ferri (RETIRED) gentoo-dev 2008-10-28 21:22:59 UTC
I just wanted to make this know to kernel maintainers:

Since upgrading kernel to version 2.6.24-12.22 two keys are now swapped on my Apple USB aluminium keyboard with danish layout. Now the keys "<" and "½" are swapped and no longer matches the actual print on the keycaps.

The error is isolated to the following commit:;a=commitdiff;h=efb3031b446d441dca5b10619503ac0bba7f9748

This commit introduced a key swapping for all "ISO" type Apple keyboards. In my case this swapping is incorrect, and generally it seems like a very bad idea to perform hard coded locale specific key mapping in kernel space as this is also done several places in user space.

The included patch reverts the behavior to the default that matches the keycap printing.

note also:

This problem is solved for me in gnome by selecting the appropriate option («Swap keycodes of two keys when Mac keyboards are misdetected by kernel» in the keyboard options menu.


the Gnome workaround practically works, it is still an issue under console.

this patch should revert kernel commit which caused the issue:

this page also has some info about that Apple Keyboards an HID related quirks.

my kernel is 2.6.25-gentoo-r7. let's hope this will be fixed with 2.6.26
Comment 1 Daniel Drake (RETIRED) gentoo-dev 2008-10-29 11:26:40 UTC
It's still not fixed in 2.6.27. Please file an upstream bug for this at, quoting efb3031b446d441dca5b10619503ac0bba7f9748 as the bad commit.

Post the new bug here when done, and ask here if you need any help. Thanks!
Comment 2 Federico Ferri (RETIRED) gentoo-dev 2008-10-29 18:19:24 UTC
Kernel bug: 10818
Subject: fix apple alu keyboard

this appears to be the very same issue
Comment 3 Federico Ferri (RETIRED) gentoo-dev 2008-11-01 12:02:13 UTC
still not fixed in 2.6.27-r2
Comment 4 Andreas Thalhammer 2010-12-28 18:05:23 UTC
Maybe this is related:

I'm using the german version of the Apple Alu USB keyboard (ISO) and I've mismapped keys ^° and <>|.

I've also filed a kernel bugzilla bug that may (if acted upon my request) also solve this problem with the danish layout.

I'd say: still not fixed in sys-kernel/gentoo-sources-2.6.36-r5
Comment 5 Andreas Thalhammer 2010-12-28 18:06:57 UTC
Ah, sorry: the kernel bugzilla bug:

(but is also linked in the gentoo forums discussion)
Comment 6 Andreas Thalhammer 2011-10-29 12:50:50 UTC
Please re-open this. The issue is still not fixed entirely.

At least on a german Apple Alu keyboard (ISO variant) two keys are still swapped. I also read at the launchpad bug tracker that it still isn't fixed for the french version, which is also ISO.

The launchpad bug (Ubuntu Linux):

There is a userspace fix, made by Dam, that works on my system:

And the udev rule with a corresponding configuration file:

This fix makes three things happen:
1) apply options to hid_apple (like Fn key option)
2) prepare settings for X11 (like apple:alupckeys)
3) possibility to remap the Fn key to an Insert key (standard PC style)

While the first two are also possible without it, the last one is only possible with this udev rule!
And besides it is a very convenient way to make the Apple Alu keyboard work out-of-the-box.


IF the kernel detects the Apple Alu to be an ISO variant (by checking the USB IDs), it then sets iso_layout for hid_apple accordingly.

I found, on my german keyboard, disabling iso_layout (echo 0 > iso_layout) makes the swapped keys issue disappear.

THIS EXCEPTION is currently being added to apple_kbd; and if not, it is very easy to add a manual override setting for /sys/module/hid_apple/parameters/iso_layout in the apple-kbd configuration file and udev rule to correct this on Gentoo.

The user of such a keyboard would have to *manually* set this, but only once, and it will work correctly thereafter. THIS IS, BECAUSE the kernel “corrects” the keys for all ISO Apple Alu keyboards, but it should only do that on certain language versions.

UNTIL a final fix is being placed INTO THE KERNEL, this working solution (apple-kbd by Dam, links above, with an additional iso_layout option) is a very convenient solution.

If a discussion is needed on this issue, the Gentoo forum is a good place to do exactly that:

Comment 7 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-02-10 16:59:06 UTC
(In reply to comment #6)
> Please re-open this. The issue is still not fixed entirely.

Upstream bug is open, we're watching it.