linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alexander F. Lent" <lx@xanderlent.com>
To: linux-input@vger.kernel.org
Cc: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	"Diego 'Flameeyes' Petteno" <flameeyes@gmail.com>,
	Christian Schuerer-Waldheim <csw@xray.at>,
	Andreas Krist <andreas.krist@gmail.com>,
	Alexey Kaminsky <me@akaminsky.net>,
	Huei-Horng Yo <hiroshi@ghostsinthelab.org>,
	"Alexander F. Lent" <lx@xanderlent.com>
Subject: [PATCH] HID: apple: Fix Wireless Keyboards when NumLock is on
Date: Thu, 11 Nov 2021 13:56:33 -0500	[thread overview]
Message-ID: <20211111185633.17567-1-lx@xanderlent.com> (raw)

Certain Apple Wireless Keyboard models (2007, 2009, and 2011) behave
strangely when NumLock is on: The driver switches into a numeric keypad
overlay mode, locking out most keys. Worse, it is not possible to exit
this mode from the keyboard, since there is no NumLock key.

This mode is not user-friendly, since it is not obvious why key presses
translate into no input or wrong input. Users think the keyboard is
broken and have resorted to workarounds like [1] and [2].
[1] https://help.ubuntu.com/community/AppleKeyboard#Numlock_on_Apple_Wireless_Keyboard
[2] https://wiki.archlinux.org/title/Apple_Keyboard#Numlock_is_on

Follow the principle of least astonishment: These keyboards don't have
keycap labels for a numeric keypad mode, so don't implement one.
(The mode is still necessary on older keyboards with the appropriate
keycap labels for a numeric keypad mode.)

Remove the APPLE_NUMLOCK_EMULATION quirk from the 9 Wireless Keyboard
2007/2009/2011 ANSI/ISO/JIS device entries in the driver's table.

Fixes: 6e7045990f35 ("HID: split Numlock emulation quirk from HID_QUIRK_APPLE_HAS_FN.")
Fixes: 23aeb61e7e1f ("HID: add device IDs for new model of Apple Wireless Keyboard")
Fixes: ad734bc15653 ("HID: hid-apple: add device ID of another wireless aluminium")
Fixes: 0a97e1e9f9a6 ("HID: apple: Add Apple wireless keyboard 2011 ANSI PID")
Fixes: bd4a7ce1da06 ("HID: apple: add Apple wireless keyboard 2011 JIS model support")
Cc: stable@vger.kernel.org
Tested-by: Alexander F. Lent <lx@xanderlent.com>
Signed-off-by: Alexander F. Lent <lx@xanderlent.com>
---
 drivers/hid/hid-apple.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index 2c9c5faa74a9..6bb62ac5a654 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -524,21 +524,19 @@ static const struct hid_device_id apple_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_JIS),
 		.driver_data = APPLE_HAS_FN },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI),
-		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
+		.driver_data = APPLE_HAS_FN },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO),
-		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
-			APPLE_ISO_TILDE_QUIRK },
+		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO),
-		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
-			APPLE_ISO_TILDE_QUIRK },
+		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
 				USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI),
-		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
+		.driver_data = APPLE_HAS_FN },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
 				USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS),
-		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
+		.driver_data = APPLE_HAS_FN },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS),
-		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
+		.driver_data = APPLE_HAS_FN },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2015),
 		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
 	{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2015),
@@ -626,12 +624,11 @@ static const struct hid_device_id apple_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS),
 		.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
-		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
+		.driver_data = APPLE_HAS_FN },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
-		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
-			APPLE_ISO_TILDE_QUIRK },
+		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS),
-		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
+		.driver_data = APPLE_HAS_FN },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY),
 		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
-- 
2.31.1


                 reply	other threads:[~2021-11-11 18:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20211111185633.17567-1-lx@xanderlent.com \
    --to=lx@xanderlent.com \
    --cc=andreas.krist@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=csw@xray.at \
    --cc=flameeyes@gmail.com \
    --cc=hiroshi@ghostsinthelab.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=me@akaminsky.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).