platform/x86: asus-nb-wmi: Add keymap for display toggle
PATCH 1/1 platform/x86: asus-nb-wmi: Add keymap for display toggle
On the Asus Zenbook 14 (UX3405MA), the Fn+F7 key combination emits WMI code 0x2d, which was previously unmapped.
Map this code to KEY_DISPLAYTOGGLE. This matches the behavior of the display toggle/projector mode key found on other Asus laptops, allowing userspace to handle multi-monitor switching or screen toggling.
Tested on ASUS Zenbook 14 UX3405MA.
--- drivers/platform/x86/asus-nb-wmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/asus-nb-wmi.c +1 -0
@@ -580,6 +580,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x2a, { KEY_SELECTIVE_SCREENSHOT } }, { KE_IGNORE, 0x2b, }, /* PrintScreen (also send via PS/2) on newer models */ { KE_IGNORE, 0x2c, }, /* CapsLock (also send via PS/2) on newer models */ + { KE_KEY, 0x2d, { KEY_DISPLAYTOGGLE } }, { KE_KEY, 0x30, { KEY_VOLUMEUP } }, { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, { KE_KEY, 0x32, { KEY_MUTE } },
Signature · 1 line
2.52.0
Quoted 2 lines · Tim Wassink
On the Asus Zenbook 14 (UX3405MA), the Fn+F7 key combination emits WMI code
0x2d, which was previously unmapped.
As in "unapped scancode: 0x2d" in dmesg?
Quoted 7 lines
Map this code to
KEY_DISPLAYTOGGLE. This matches the behavior of the display toggle/projector mode key found on other Asus laptops, allowing userspace to handle multi-monitor switching or screen toggling.Tested on ASUS Zenbook 14 UX3405MA.
Signed-off-by Tim Wassink <[email protected]>
Thank you for this!
Quoted 16 lines
--- drivers/platform/x86/asus-nb-wmi.c | 1 + 1 file changed, 1 insertion(+)drivers/platform/x86/asus-nb-wmi.c +1
-0@@ -580,6 +580,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x2a, { KEY_SELECTIVE_SCREENSHOT } }, { KE_IGNORE, 0x2b, }, /* PrintScreen (also send via PS/2) on newer models */ { KE_IGNORE, 0x2c, }, /* CapsLock (also send via PS/2) on newer models */ + { KE_KEY, 0x2d, { KEY_DISPLAYTOGGLE } }, { KE_KEY, 0x30, { KEY_VOLUMEUP } }, { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, { KE_KEY, 0x32, { KEY_MUTE } },
Quoted 6 lines · Denis Benato
Quoted 2 lines · Tim Wassink
On the Asus Zenbook 14 (UX3405MA), the Fn+F7 key combination emits WMI code
0x2d, which was previously unmapped.As in "unapped scancode:
0x2d" in dmesg?
Hi Denis,
Thank you for the review!
Yes, exactly. In dmesg it was reporting:
[ 906.273271] asus_wmi: Unknown key code 0x2d
I found out about it through evtest. It showed the following when the key was pressed:
Event: type 4 (EV_MSC), code 4 (MSC_SCAN), value 2d
Event: type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1
Best regards,
Tim
Ilpo Järvinen
maintainerQuoted 8 lines · Tim Wassink
On the Asus Zenbook 14 (UX3405MA), the Fn+F7 key combination emits WMI code
0x2d, which was previously unmapped.Map this code to
KEY_DISPLAYTOGGLE. This matches the behavior of the display toggle/projector mode key found on other Asus laptops, allowing userspace to handle multi-monitor switching or screen toggling.[...]
Thank you for your contribution, it has been applied to my local review-ilpo-fixes branch. Note it will show up in the public platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: asus-nb-wmi: Add keymap for display toggle
commit: e521dc1687834d0e8c7506f1fdf00daab4ebb51d
--
i.