platform/x86: asus-wmi: map more keys on ExpertBook B9
Subsystems (4)
v2 cover platform/x86: asus-wmi: map more keys on ExpertBook B9
Hi,
second version of the set [1], changed according to review by Hans de Goede.
Now allocates a new keycode KEY_FN_SPACE for Fn+space.
The key mappings now are:
* Fn+space -> FN_SPACE * Fn+f -> FN_F * <noise cancel> -> F13 * Fn+<noise cancel> -> F14
[1] https://lore.kernel.org/platform-driver-x86/[email protected]/
PATCH v2 1/2 Input: allocate a keycode for Fn+space
The Asus ExpertBook B9 laptop sends a WMI event when Fn+space is pressed. Since I could not find any information on what this combination is intended to do on this or any other Asus laptop, allocate a KEY_FN_SPACE keycode for it.
--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/input-event-codes.h +1 -0
@@ -548,6 +548,7 @@#define KEY_FN_S 0x1e3#define KEY_FN_B 0x1e4#define KEY_FN_RIGHT_SHIFT 0x1e5 +#define KEY_FN_SPACE 0x1e6#define KEY_BRL_DOT1 0x1f1#define KEY_BRL_DOT2 0x1f2
Signature · 1 line
2.39.5
Re: [PATCH v2 1/2] Input: allocate a keycode for Fn+space
Hi,
Quoted 6 lines · Anton Khirnov
The Asus ExpertBook B9 laptop sends a WMI event when Fn+space is pressed. Since I could not find any information on what this combination is intended to do on this or any other Asus laptop, allocate a
KEY_FN_SPACEkeycode for it.Signed-off-by Anton Khirnov <[email protected]>
Thanks, patch looks good to me:
Regards,
Hans
Quoted 16 lines
--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)include/uapi/linux/input-event-codes.h +1
-0@@ -548,6 +548,7 @@#define KEY_FN_S 0x1e3#define KEY_FN_B 0x1e4#define KEY_FN_RIGHT_SHIFT 0x1e5 +#define KEY_FN_SPACE 0x1e6#define KEY_BRL_DOT1 0x1f1#define KEY_BRL_DOT2 0x1f2
Re: [PATCH v2 1/2] Input: allocate a keycode for Fn+space
In reply to Anton KhirnovHi Dmitry,
could you please look at this?
Thanks,
Signature · 1 line
Anton Khirnov
Dmitry Torokhov
maintainerRe: [PATCH v2 1/2] Input: allocate a keycode for Fn+space
In reply to Anton KhirnovHi Anton,
Quoted 15 lines · Anton Khirnov
The Asus ExpertBook B9 laptop sends a WMI event when Fn+space is pressed. Since I could not find any information on what this combination is intended to do on this or any other Asus laptop, allocate a
KEY_FN_SPACEkeycode for it.Signed-off-by Anton Khirnov <[email protected]>--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)include/uapi/linux/input-event-codes.h +0
-0
include/uapi/linux/input-event-codes.h line 551
Quoted 4 lines
include/uapi/linux/input-event-codes.h +1
-0@@ -548,6 +548,7 @@#define KEY_FN_S 0x1e3#define KEY_FN_B 0x1e4#define KEY_FN_RIGHT_SHIFT 0x1e5 +#define KEY_FN_SPACE 0x1e6
I'd rather we did not add more codes with no defined meaning. I regret that we have KEY_FN_* (with the exception of KEY_FN itself). Since nobody knows what this key is supposed to do maybe map it to KEY_RESERVED and whoever wants to use it can map it to a concrete key code via udev?
Thanks.
Signature · 1 line
Dmitry
Re: [PATCH v2 1/2] Input: allocate a keycode for Fn+space
Quoted 29 lines · Dmitry Torokhov
Hi Anton,
Quoted 15 lines · Anton Khirnov
The Asus ExpertBook B9 laptop sends a WMI event when Fn+space is pressed. Since I could not find any information on what this combination is intended to do on this or any other Asus laptop, allocate a
KEY_FN_SPACEkeycode for it.Signed-off-by Anton Khirnov <[email protected]>--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)include/uapi/linux/input-event-codes.h +0
-0include/uapi/linux/input-event-codes.h line 551
Quoted 4 lines
include/uapi/linux/input-event-codes.h +1
-0@@ -548,6 +548,7 @@#define KEY_FN_S 0x1e3#define KEY_FN_B 0x1e4#define KEY_FN_RIGHT_SHIFT 0x1e5 +#define KEY_FN_SPACE 0x1e6I'd rather we did not add more codes with no defined meaning. I regret that we have KEY_FN_* (with the exception of
KEY_FNitself). Since nobody knows what this key is supposed to do maybe map it toKEY_RESERVEDand whoever wants to use it can map it to a concrete key code via udev?
Quoted 2 lines
Thanks.
Any chance you can look at Windows and see what the key actually does when you have the matching OEM software installed?
I've seen a bunch of laptops that FN+SPACE turns on/off keyboard backlight. Maybe that's what it does.
Re: [PATCH v2 1/2] Input: allocate a keycode for Fn+space
Hi Mario,
Quoting Mario Limonciello (AMD) (kernel.org) (2025-09-19 07:36:31)
Quoted 30 lines · Dmitry Torokhov
Quoted 29 lines
Hi Anton,
Quoted 15 lines · Anton Khirnov
The Asus ExpertBook B9 laptop sends a WMI event when Fn+space is pressed. Since I could not find any information on what this combination is intended to do on this or any other Asus laptop, allocate a
KEY_FN_SPACEkeycode for it.Signed-off-by Anton Khirnov <[email protected]>--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)include/uapi/linux/input-event-codes.h +0
-0include/uapi/linux/input-event-codes.h line 551
Quoted 4 lines
include/uapi/linux/input-event-codes.h +1
-0@@ -548,6 +548,7 @@#define KEY_FN_S 0x1e3#define KEY_FN_B 0x1e4#define KEY_FN_RIGHT_SHIFT 0x1e5 +#define KEY_FN_SPACE 0x1e6I'd rather we did not add more codes with no defined meaning. I regret that we have KEY_FN_* (with the exception of
KEY_FNitself). Since nobody knows what this key is supposed to do maybe map it toKEY_RESERVEDand whoever wants to use it can map it to a concrete key code via udev?
Quoted 5 lines
Quoted 2 lines
Thanks.
Any chance you can look at Windows and see what the key actually does when you have the matching OEM software installed?
Unfortunately I removed Windows from this machine right after buying it, and reinstalling it would be too invasive. I did ask someone to test on a different Asus laptop running Windows, the key did not seem to do anything.
Quoted 2 lines
I've seen a bunch of laptops that FN+SPACE turns on/off keyboard backlight. Maybe that's what it does.
Fn+F7 toggles keyboard backlight on this laptop, so probably not. I'm willing to believe it's a leftover from older hardware where it did do something and they just forgot to disable it.
Cheers,
Signature · 1 line
Anton Khirnov
Re: [PATCH v2 1/2] Input: allocate a keycode for Fn+space
In reply to Dmitry TorokhovHi Dmitry,
Quoting Dmitry Torokhov (2025-09-19 07:12:38)
Quoted 13 lines
Hi Anton,
Quoted 10 lines · Anton Khirnov
The Asus ExpertBook B9 laptop sends a WMI event when Fn+space is pressed. Since I could not find any information on what this combination is intended to do on this or any other Asus laptop, allocate a
KEY_FN_SPACEkeycode for it.Signed-off-by Anton Khirnov <[email protected]>--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)
Quoted 15 lines
include/uapi/linux/input-event-codes.h line 551
Quoted 9 lines
include/uapi/linux/input-event-codes.h +1
-0@@ -548,6 +548,7 @@#define KEY_FN_S 0x1e3#define KEY_FN_B 0x1e4#define KEY_FN_RIGHT_SHIFT 0x1e5 +#define KEY_FN_SPACE 0x1e6I'd rather we did not add more codes with no defined meaning. I regret that we have KEY_FN_* (with the exception of
KEY_FNitself). Since nobody knows what this key is supposed to do maybe map it toKEY_RESERVEDand whoever wants to use it can map it to a concrete key code via udev?
The problem with that approach is that on this laptop we have TWO keys with unknown meanings - fn+space and fn+f (KEY_FN_F already exists). Using KEY_RESERVED for one of them would be inconsistent then.
Could you elaborate on why are you against KEY_FN_* codes? I understand they can be abused, but in some cases (such as this one) it genuinely seems the least bad way to characterize a key.
Cheers,
Signature · 1 line
Anton Khirnov
PATCH v2 2/2 platform/x86: asus-wmi: map more keys on ExpertBook B9
In reply to Anton Khirnov* there is a dedicated "noise cancel" key in top row, between mic mute and PrintScreen; it sends 0xCA when pressed by itself (mapped to F13), 0xCB with Fn (mapped to F14)
* Fn+f sends 0x9D; it is not documented in the manual, but some web search results mention "asus intelligent performance"; mapped to FN_F
* Fn+space sends 0x5B; it is not documented or mentioned anywhere I could find; mapped to FN_SPACE
--- drivers/platform/x86/asus-nb-wmi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +4 -0
@@ -582,6 +582,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x55, { KEY_CALC } }, { KE_IGNORE, 0x57, }, /* Battery mode */ { KE_IGNORE, 0x58, }, /* AC mode */ + { KE_KEY, 0x5B, { KEY_FN_SPACE } }, { KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */ { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */ { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
@@ -618,6 +619,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */ { KE_KEY, 0x95, { KEY_MEDIA } }, { KE_KEY, 0x99, { KEY_PHONE } }, /* Conflicts with fan mode switch */ + { KE_KEY, 0X9D, { KEY_FN_F } }, { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
@@ -632,6 +634,8 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */ { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, + { KE_KEY, 0xCA, { KEY_F13 } }, /* Noise cancelling on Expertbook B9 */ + { KE_KEY, 0xCB, { KEY_F14 } }, /* Fn+noise-cancel */ { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ { KE_IGNORE, 0xCF, }, /* AC mode */ { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
Signature · 1 line
2.39.5
Hi,
Quoted 9 lines · Anton Khirnov
* there is a dedicated "noise cancel" key in top row, between mic mute and PrintScreen; it sends
0xCAwhen pressed by itself (mapped to F13),0xCBwith Fn (mapped to F14)
* Fn+f sends0x9D; it is not documented in the manual, but some web search results mention "asus intelligent performance"; mapped toFN_F
* Fn+space sends0x5B; it is not documented or mentioned anywhere I could find; mapped toFN_SPACESigned-off-by Anton Khirnov <[email protected]>
Thanks, patch looks good to me:
Regards,
Hans
Quoted 33 lines
--- drivers/platform/x86/asus-nb-wmi.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/platform/x86/asus-nb-wmi.c +4
-0@@ -582,6 +582,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x55, { KEY_CALC } }, { KE_IGNORE, 0x57, }, /* Battery mode */ { KE_IGNORE, 0x58, }, /* AC mode */ + { KE_KEY, 0x5B, { KEY_FN_SPACE } }, { KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */ { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */ { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */@@ -618,6 +619,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */ { KE_KEY, 0x95, { KEY_MEDIA } }, { KE_KEY, 0x99, { KEY_PHONE } }, /* Conflicts with fan mode switch */ + { KE_KEY, 0X9D, { KEY_FN_F } }, { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */@@ -632,6 +634,8 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */ { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, + { KE_KEY, 0xCA, { KEY_F13 } }, /* Noise cancelling on Expertbook B9 */ + { KE_KEY, 0xCB, { KEY_F14 } }, /* Fn+noise-cancel */ { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ { KE_IGNORE, 0xCF, }, /* AC mode */ { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
PATCH v3 1/1 platform/x86: asus-wmi: map more keys on ExpertBook B9
* there is a dedicated "noise cancel" key in top row, between mic mute and PrintScreen; it sends 0xCA when pressed by itself (mapped to F13), 0xCB with Fn (mapped to F14)
* Fn+f sends 0x9D; it is not documented in the manual, but some web search results mention "asus intelligent performance"; mapped to FN_F
---
Hi Hans,
would you mind applying this version of the patch, with the Fn+space mapping left out for now?
Thanks
---
drivers/platform/x86/asus-nb-wmi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +3 -0
@@ -618,6 +618,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */ { KE_KEY, 0x95, { KEY_MEDIA } }, { KE_KEY, 0x99, { KEY_PHONE } }, /* Conflicts with fan mode switch */ + { KE_KEY, 0X9D, { KEY_FN_F } }, { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
@@ -632,6 +633,8 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */ { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, + { KE_KEY, 0xCA, { KEY_F13 } }, /* Noise cancelling on Expertbook B9 */ + { KE_KEY, 0xCB, { KEY_F14 } }, /* Fn+noise-cancel */ { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ { KE_IGNORE, 0xCF, }, /* AC mode */ { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
Signature · 1 line
2.39.5
Ilpo Järvinen
maintainerQuoted 11 lines · Anton Khirnov
* there is a dedicated "noise cancel" key in top row, between mic mute and PrintScreen; it sends
0xCAwhen pressed by itself (mapped to F13),0xCBwith Fn (mapped to F14)
* Fn+f sends0x9D; it is not documented in the manual, but some web search results mention "asus intelligent performance"; mapped toFN_FSigned-off-by Anton Khirnov <[email protected]>---
Hi Hans,
would you mind applying this version of the patch, with the Fn+space mapping left out for now?
Hi Anton,
These days I'm the one handling pdx86 patches. I took this into the review-ilpo-fixes branch and reinstated Hans' ack.
My experience is that long delays are nothing unusual when interacting with Dimitry so don't get discouraged by that when it comes to the rest of v2 content. Once Dimitry has okay'ed the input side change, please resubmit the rest.
--
i.
Quoted 28 lines
Thanks
---drivers/platform/x86/asus-nb-wmi.c | 3 +++ 1 file changed, 3 insertions(+)drivers/platform/x86/asus-nb-wmi.c +3
-0@@ -618,6 +618,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */ { KE_KEY, 0x95, { KEY_MEDIA } }, { KE_KEY, 0x99, { KEY_PHONE } }, /* Conflicts with fan mode switch */ + { KE_KEY, 0X9D, { KEY_FN_F } }, { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */@@ -632,6 +633,8 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */ { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, + { KE_KEY, 0xCA, { KEY_F13 } }, /* Noise cancelling on Expertbook B9 */ + { KE_KEY, 0xCB, { KEY_F14 } }, /* Fn+noise-cancel */ { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ { KE_IGNORE, 0xCF, }, /* AC mode */ { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
Hi Ilpo,
Quoting Ilpo Järvinen (2025-08-28 18:18:51)
Quoted 4 lines
Hi Anton,
These days I'm the one handling pdx86 patches. I took this into the review-ilpo-fixes branch and reinstated Hans' ack.
Thank you, much appreciated.
Quoted 4 lines
My experience is that long delays are nothing unusual when interacting with Dimitry so don't get discouraged by that when it comes to the rest of v2 content. Once Dimitry has okay'ed the input side change, please resubmit the rest.
Sure, I will.
Cheers,
Signature · 1 line
Anton Khirnov