Skip to content

Commit 235985d

Browse files
committed
platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events
Newer Asus laptops send the following new WMI event codes when some of the F1 - F12 "media" hotkeys are pressed: 0x2a Screen Capture 0x2b PrintScreen 0x2c CapsLock Map 0x2a to KEY_SELECTIVE_SCREENSHOT mirroring how similar hotkeys are mapped on other laptops. PrintScreem and CapsLock are also reported as normal PS/2 keyboard events, map these event codes to KE_IGNORE to avoid "Unknown key code 0x%x\n" log messages. Reported-by: James John <[email protected]> Closes: https://lore.kernel.org/platform-driver-x86/[email protected]/ Closes: https://bbs.archlinux.org/viewtopic.php?pid=2123716 Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a5b92be commit 235985d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/platform/x86/asus-nb-wmi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
531531
static const struct key_entry asus_nb_wmi_keymap[] = {
532532
{ KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } },
533533
{ KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } },
534+
{ KE_KEY, 0x2a, { KEY_SELECTIVE_SCREENSHOT } },
535+
{ KE_IGNORE, 0x2b, }, /* PrintScreen (also send via PS/2) on newer models */
536+
{ KE_IGNORE, 0x2c, }, /* CapsLock (also send via PS/2) on newer models */
534537
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
535538
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
536539
{ KE_KEY, 0x32, { KEY_MUTE } },

0 commit comments

Comments
 (0)