mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 06:55:13 +08:00
HID: allow disabling hard-coded ISO-layout for Apple keyboards
This patch adds a new option named "iso_layout" to the driver "hid-apple.ko", to allow disabling of the hard-coded ISO-layout. Disabling the hard-coded layout solves the problem that the kernel-module only works perfectly for the english/american version of the Apple aluminum keyboard. Other versions have swapped keys, e.g. the "<"-key is swapped with "^"-key on the german keyboard. There is a very long bug-entry on Launchpad to this problem: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/214786 Signed-off-by: Stefan Glasenhardt <stefan@glasen-hardt.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
722612cd51
commit
54a6593d65
@ -40,6 +40,11 @@ module_param(fnmode, uint, 0644);
|
|||||||
MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, "
|
MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, "
|
||||||
"[1] = fkeyslast, 2 = fkeysfirst)");
|
"[1] = fkeyslast, 2 = fkeysfirst)");
|
||||||
|
|
||||||
|
static unsigned int iso_layout = 1;
|
||||||
|
module_param(iso_layout, uint, 0644);
|
||||||
|
MODULE_PARM_DESC(iso_layout, "Enable/Disable hardcoded ISO-layout of the keyboard. "
|
||||||
|
"(0 = disabled, [1] = enabled)");
|
||||||
|
|
||||||
struct apple_sc {
|
struct apple_sc {
|
||||||
unsigned long quirks;
|
unsigned long quirks;
|
||||||
unsigned int fn_on;
|
unsigned int fn_on;
|
||||||
@ -199,6 +204,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (iso_layout) {
|
||||||
if (asc->quirks & APPLE_ISO_KEYBOARD) {
|
if (asc->quirks & APPLE_ISO_KEYBOARD) {
|
||||||
trans = apple_find_translation(apple_iso_keyboard, usage->code);
|
trans = apple_find_translation(apple_iso_keyboard, usage->code);
|
||||||
if (trans) {
|
if (trans) {
|
||||||
@ -206,6 +212,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user