From: Dag Bakke <dag@bakke.com>
To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] fix apple alu keyboard with numpad
Date: Sun, 27 Apr 2008 13:19:11 +0200 [thread overview]
Message-ID: <4814612F.5030606@bakke.com> (raw)
The nice apple alu keyboards with numpads are pretty much unusable in
vanilla 2.6.25.
(http://images.apple.com/keyboard/images/gallery/wired_1_20070813.jpg)
Hitting the 'clear' key (=numlock) disables the numpad, and maps multiple
alphanumeric keys to numpad symbols in typical laptopkeyboard fashion.
Furthermore, some of the F-keys do double duty as multimedia keys. The
vanilla kernel defaults to multimedia keys, requiring the user to hit
the 'fn' key to get F-key events. I use F-keys more often than multimedia
keys, so I included the patch to change the default to be F-keys.
The following patch is taken from:
https://bugs.launchpad.net/mactel-support/+bug/201887
and appears to have been written by Eric Johney. I have merely lifted
the two patches from the webpage above and submitted it, as I couldn't
see it upstream after a brief search.
Tested-by: dag@bakke.com
--- linux-2.6.25-gentoo/drivers/hid/hid-input.c 2008-04-17 04:49:44.000000000 +0200
+++ linux-2.6.25-gentoo-r1-apple/drivers/hid/hid-input.c 2008-04-25 23:07:52.925613698 +0200
@@ -34,7 +34,7 @@
#include <linux/hid.h>
#include <linux/hid-debug.h>
-static int hid_apple_fnmode = 1;
+static int hid_apple_fnmode = 2;
module_param_named(pb_fnmode, hid_apple_fnmode, int, 0644);
MODULE_PARM_DESC(pb_fnmode,
"Mode of fn key on Apple keyboards (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)");
@@ -218,8 +218,9 @@
}
}
- if (test_bit(usage->code, hid->pb_pressed_numlock) ||
- test_bit(LED_NUML, input->led)) {
+ if ((test_bit(usage->code, hid->pb_pressed_numlock) ||
+ test_bit(LED_NUML, input->led)) &&
+ (hid->product < 0x220 ||hid->product >= 0x300)) {
trans = find_translation(powerbook_numlock_keys, usage->code);
if (trans) {
For "completeness" and the benfit of someone finding this in an archive
later, the following 4 commands provides correct keys for
the multimediakeys in X:
setxkbmap -model macintosh
xmodmap -e "keycode 162 = XF86AudioPlay"
xmodmap -e "keycode 153 = XF86AudioNext"
xmodmap -e "keycode 144 = XF86AudioPrev"
Works with a US layout keyboard, anyway.
Regards,
Dag B.
next reply other threads:[~2008-04-27 12:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-27 11:19 Dag Bakke [this message]
2008-05-06 19:54 ` [PATCH] fix apple alu keyboard with numpad Andrew Morton
2008-05-06 20:46 ` Jiri Kosina
2008-05-08 17:24 ` Dag Bakke
2008-05-11 22:54 ` Jiri Kosina
2008-05-12 7:45 ` Dag Bakke
2008-05-06 23:43 ` Matthew Garrett
2008-05-08 17:29 ` Dag Bakke
2008-05-08 17:42 ` Matthew Garrett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4814612F.5030606@bakke.com \
--to=dag@bakke.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.