Skip to contentSkip to conversation

platform/x86: asus-wmi: map more keys on ExpertBook B9

PATCH Superseded Anton Khirnov 2 participants 7 messages Jul 2, 2025 – Jul 14, 2025

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 F14), 0xCB with Fn (mapped to F15)
* Fn+f sends 0x9D; it is not documented in the manual, but some web search results mention "asus intelligent performance"; mapped to PROG2
* Fn+space sends 0x5B; it is not documented or mentioned anywhere I could find; mapped to PROG3

---
 drivers/platform/x86/asus-nb-wmi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +4 -0
index 3f8b2a324efd..42d7b435ba63 100644
@@ -573,6 +573,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_PROG3 } }, /* 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 */
@@ -609,6 +610,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_PROG2 } }, /* 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 */
@@ -623,6 +625,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_F14 } }, /* Noise cancelling on Expertbook B9 */
+	{ KE_KEY, 0xCB, { KEY_F15 } }, /* 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
#1 lore raw

Ping, can anyone please look at this patch?

Thanks,

Signature · 1 line
Anton Khirnov
maintainer
#2 lore raw
In reply to Anton Khirnov

Hi,

Quoted 18 lines · 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 F14), 0xCB with Fn (mapped to F15)
* Fn+f sends 0x9D; it is not documented in the manual, but some web search results mention "asus intelligent performance"; mapped to PROG2
* Fn+space sends 0x5B; it is not documented or mentioned anywhere I could find; mapped to PROG3

---
 drivers/platform/x86/asus-nb-wmi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +0 -0
index 3f8b2a324efd..42d7b435ba63 100644

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 576

Quoted 4 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
@@ -573,6 +573,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_PROG3 } }, /* Fn+space */

What is this key-combo supposed to do, is there any icon for this on the spacebar? What does it do under Windows?

Based on other laptops I would expect this to maybe need to be KEY_KBDILLUMTOGGLE, which toggles the kbd backlight on/off ?

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 577

Quoted 1 line
drivers/platform/x86/asus-nb-wmi.c +0 -0
 	{ KE_KEY, 0x5C, { KEY_F15 } },  /* Power Gear key */

Why KEY_F15, Why not some other KEY_ ? Generally speaking the key-code send should match the intended purpose of they key / key-combo. E.g. If the button opens the control-panel under Windows use KEY_CONTROLPANEL

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 613

Quoted 7 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
 	{ KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
 	{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
@@ -609,6 +610,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_PROG2 } }, /* Fn+f */

Same remark as on the other keys. what does this do under Windows ?

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 628

Quoted 8 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
 	{ KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
 	{ KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
 	{ KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
@@ -623,6 +625,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_F14 } }, /* Noise cancelling on Expertbook B9 */

KEY_SOUND ?

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 629

Quoted 1 line
drivers/platform/x86/asus-nb-wmi.c +1 -0
+	{ KE_KEY, 0xCB, { KEY_F15 } }, /* Fn+noise-cancel */

What does Fn + noise-cancel do under Windows ?

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 632

Quoted 3 lines
drivers/platform/x86/asus-nb-wmi.c +0 -0
 	{ KE_IGNORE, 0xC6, },  /* Ambient Light Sensor notification */
 	{ KE_IGNORE, 0xCF, },	/* AC mode */
 	{ KE_KEY, 0xFA, { KEY_PROG2 } },           /* Lid flip action */

Regards,

Hans

#3 lore raw

Hi Hans,
Quoting Hans de Goede (2025-07-14 14:34:04)

Quoted 16 lines

Hi,

Quoted 13 lines · 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 F14), 0xCB with Fn (mapped to F15)
* Fn+f sends 0x9D; it is not documented in the manual, but some web search results mention "asus intelligent performance"; mapped to PROG2
* Fn+space sends 0x5B; it is not documented or mentioned anywhere I could find; mapped to PROG3

---
 drivers/platform/x86/asus-nb-wmi.c | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 12 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 576

Quoted 9 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
index 3f8b2a324efd..42d7b435ba63 100644
@@ -573,6 +573,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_PROG3 } }, /* Fn+space */

What is this key-combo supposed to do, is there any icon for this on the spacebar? What does it do under Windows?

I don't have Windows installed, so I cannot test what any of these keys do there.

I searched the web for any mentions of this key combination and found nothing whatsoever, the manual is also silent. But it does generate an event, so it seemed reasonable to make use of it.

Quoted 2 lines

Based on other laptops I would expect this to maybe need to be KEY_KBDILLUMTOGGLE, which toggles the kbd backlight on/off ?

Keyboard backlight is Fn+F7 on this laptop. That said, I'm fine with any key that is acceptable to you and/or other maintainers.

Quoted 7 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 577

Quoted 2 lines
drivers/platform/x86/asus-nb-wmi.c +0 -0
 	{ KE_KEY, 0x5C, { KEY_F15 } },  /* Power Gear key */

Why KEY_F15, Why not some other KEY_ ? Generally speaking the key-code send should match the intended purpose of they key / key-combo. E.g. If the button opens the control-panel under Windows use KEY_CONTROLPANEL

Err I'm not doing anything to this one.

Quoted 7 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 613

Quoted 5 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
@@ -609,6 +610,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_PROG2 } }, /* Fn+f */

Same remark as on the other keys. what does this do under Windows ?

As per above, cannot test. But in this case a web search suggests that (on some other Asus laptop) it switches between performance profiles.

Quoted 7 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 628

Quoted 5 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
@@ -623,6 +625,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_F14 } }, /* Noise cancelling on Expertbook B9 */

KEY_SOUND ?

Can do, but then what about the fn+ version? Ideally they should be related.

Quoted 3 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 629

Quoted 1 line
drivers/platform/x86/asus-nb-wmi.c +1 -0
+	{ KE_KEY, 0xCB, { KEY_F15 } }, /* Fn+noise-cancel */

What does Fn + noise-cancel do under Windows ?

As per the manual:

Built-in microphone: Toggles between single presenter conference call
mode or multi presenter conference call mode.
External microphone: Toggles ASUS AI Noise-Canceling.

Thanks for the review,

Signature · 1 line
Anton Khirnov
maintainer
#4 lore raw

Hi,

Quoted 38 lines · Anton Khirnov

Hi Hans,
Quoting Hans de Goede (2025-07-14 14:34:04)

Quoted 16 lines

Hi,

Quoted 13 lines · 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 F14), 0xCB with Fn (mapped to F15)
* Fn+f sends 0x9D; it is not documented in the manual, but some web search results mention "asus intelligent performance"; mapped to PROG2
* Fn+space sends 0x5B; it is not documented or mentioned anywhere I could find; mapped to PROG3

---
 drivers/platform/x86/asus-nb-wmi.c | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 12 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 576

Quoted 9 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
index 3f8b2a324efd..42d7b435ba63 100644
@@ -573,6 +573,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_PROG3 } }, /* Fn+space */

What is this key-combo supposed to do, is there any icon for this on the spacebar? What does it do under Windows?

I don't have Windows installed, so I cannot test what any of these keys do there.

I searched the web for any mentions of this key combination and found nothing whatsoever, the manual is also silent. But it does generate an event, so it seemed reasonable to make use of it.

Quoted 5 lines
Quoted 2 lines

Based on other laptops I would expect this to maybe need to be KEY_KBDILLUMTOGGLE, which toggles the kbd backlight on/off ?

Keyboard backlight is Fn+F7 on this laptop. That said, I'm fine with any key that is acceptable to you and/or other maintainers.

Ok, so no KEY_KBDILLUMTOGGLE then if that already is at Fn+F7

So lets stick with a KEY_PROG# option here,
note asus-nb-wmi already used PROG# for:

        { KE_KEY, 0x38, { KEY_PROG3 } }, /* Armoury Crate */
        { KE_KEY, 0x86, { KEY_PROG1 } }, /* MyASUS Key */
        { KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */
        { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
        { KE_KEY, 0xBD, { KEY_PROG2 } }, /* Lid flip action on ROG xflow */

I guess you checked that this laptop does not send the 0x83 / "Armoury Crate" events? What about 0x86 / "MyAsus"? If there is no MyAsus key I would prefer to use KEY_PROG1 here.

Or you can add a KEY_FN_SPACE to input-event-codes.h grouping it together with the existing Fn + X combos there.

Quoted 10 lines
Quoted 8 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 577

Quoted 3 lines
drivers/platform/x86/asus-nb-wmi.c +0 -0
 	{ KE_KEY, 0x5C, { KEY_F15 } },  /* Power Gear key */

Why KEY_F15, Why not some other KEY_ ? Generally speaking the key-code send should match the intended purpose of they key / key-combo. E.g. If the button opens the control-panel under Windows use KEY_CONTROLPANEL

Err I'm not doing anything to this one.

My bad, sorry.

Quoted 10 lines
Quoted 7 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 613

Quoted 5 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
@@ -609,6 +610,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_PROG2 } }, /* Fn+f */

Same remark as on the other keys. what does this do under Windows ?

As per above, cannot test. But in this case a web search suggests that (on some other Asus laptop) it switches between performance profiles.

You can use KEY_FN_F for this one then.

Quoted 10 lines
Quoted 7 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 628

Quoted 5 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
@@ -623,6 +625,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_F14 } }, /* Noise cancelling on Expertbook B9 */

KEY_SOUND ?

Can do, but then what about the fn+ version? Ideally they should be related.

Hmm, can use KEY_PROG3 + KEY_PROG4, assuming that the Fn+ spacebar becomes KEY_PROG1 and that KEY_PROG3 / PROG4 are otherwise free ?

If not then why start at KEY_F14 and not at KEY_F13, does this laptop's keyboard has a key which sends:

        { KE_KEY, 0x71, { KEY_F13 } }, /* General-purpose button */

Also are there no conflicts with some of the other entries which send F14 / F15 ?

As in no other keys which generate the existing codes mapped to F13 / F14 / F15 ?

Quoted 9 lines
Quoted 3 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 629

Quoted 1 line
drivers/platform/x86/asus-nb-wmi.c +1 -0
+	{ KE_KEY, 0xCB, { KEY_F15 } }, /* Fn+noise-cancel */

What does Fn + noise-cancel do under Windows ?

As per the manual:

Built-in microphone: Toggles between single presenter conference call
mode or multi presenter conference call mode.
External microphone: Toggles ASUS AI Noise-Canceling.

Thanks.

Regards,

Hans

#5 lore raw

Quoting Hans de Goede (2025-07-14 15:27:58)

Quoted 17 lines
Quoted 5 lines
Quoted 2 lines

Based on other laptops I would expect this to maybe need to be KEY_KBDILLUMTOGGLE, which toggles the kbd backlight on/off ?

Keyboard backlight is Fn+F7 on this laptop. That said, I'm fine with any key that is acceptable to you and/or other maintainers.

Ok, so no KEY_KBDILLUMTOGGLE then if that already is at Fn+F7

So lets stick with a KEY_PROG# option here,
note asus-nb-wmi already used PROG# for:

        { KE_KEY, 0x38, { KEY_PROG3 } }, /* Armoury Crate */
        { KE_KEY, 0x86, { KEY_PROG1 } }, /* MyASUS Key */
        { KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */
        { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
        { KE_KEY, 0xBD, { KEY_PROG2 } }, /* Lid flip action on ROG xflow */
Quoted 3 lines

I guess you checked that this laptop does not send the 0x83 / "Armoury Crate" events? What about 0x86 / "MyAsus"? If there is no MyAsus key I would prefer to use KEY_PROG1 here.

That is sent by this laptop as Fn+F12, which is why I started at PROG2.

Quoted 2 lines

Or you can add a KEY_FN_SPACE to input-event-codes.h grouping it together with the existing Fn + X combos there.

I wasn't sure how big of a deal adding new KEY_ values is. If that isn't too much of a hassle, I can do that and that takes care of Fn+space/f consistently.

Quoted 14 lines
Quoted 6 lines
Quoted 3 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 628

Quoted 1 line
drivers/platform/x86/asus-nb-wmi.c +1 -0
+	{ KE_KEY, 0xCA, { KEY_F14 } }, /* Noise cancelling on Expertbook B9 */

KEY_SOUND ?

Can do, but then what about the fn+ version? Ideally they should be related.

Hmm, can use KEY_PROG3 + KEY_PROG4, assuming that the Fn+ spacebar becomes KEY_PROG1 and that KEY_PROG3 / PROG4 are otherwise free ?

If not then why start at KEY_F14 and not at KEY_F13, does this laptop's keyboard has a key which sends:

Quoted 7 lines
        { KE_KEY, 0x71, { KEY_F13 } }, /* General-purpose button */

Also are there no conflicts with some of the other entries which send F14 / F15 ?

As in no other keys which generate the existing codes mapped to F13 / F14 / F15 ?

The reason I picked F14 is that the key is physically located two keys to the right of F12. PROG1 is taken, but the others are free, so I can do either F13/F14, or PROG2/3.

For posterity, here's a list of all codes sent by this laptop:
* {up,down,left,right}: ACPI button/{up,down,left,right} (in addition to normal ATK event)
* fn-{up,down,left,right}: ATK {PgUp,PgDown,Home,End}
* copilot key (right of AltGr): ATK shift+win+F17
press+release (immediately, releasing the physical key does nothing)
* fn-lctrl: ATK compose (menu)
* fn-space: WMI unknown key 0x5b
* fn-b: ATK pause (scancode 0xc5)
* fn-p: ATK pause (scancode 0xc6)
* fn-k: ATK scrolllock
* fn-f: WMI unknown key 0x9d (supposed to be "asus intelligent performance")
* fn-a: no event visible anywhere
* fn-esc: toggles between fn/f keys being primary, sends no visible keys except ACPI event
* fn-(1-4): WMI scancode 0x61-0x64 (switch video mode);
also ACPI video/switchmode event identical for all 4 keys
* fn-(f1/f2/f3): ATK mute/voldown/volup + ACPI button/{mute,volumedown,volumeup}
* fn-f4/f5: ACPI brightness down/up
* fn-f6: WMI scancode 0x6b - F21
* fn-f7: keyboard backlight, sends no visible keys anywhere except ACPI event
* fn-f8: ATK win+p
* fn-f9: ATK win+l
* fn-f10: no event visible anywhere
* fn-f11: ATK win+shift+s
* fn-f12: WMI prog1 (scancode 0x86) + ACPI button/prog1
* mic-mute: WMI F20 (scancode 0xbe) + ACPI button/f20
* mic noise key (right of mic-mute): WMI scancode 0xca; fn- sends 0xcb
* fn-del: insert

Cheers,

Signature · 1 line
Anton Khirnov
maintainer
#6 lore raw

Hi,

Quoted 22 lines · Anton Khirnov

Quoting Hans de Goede (2025-07-14 15:27:58)

Quoted 17 lines
Quoted 5 lines
Quoted 2 lines

Based on other laptops I would expect this to maybe need to be KEY_KBDILLUMTOGGLE, which toggles the kbd backlight on/off ?

Keyboard backlight is Fn+F7 on this laptop. That said, I'm fine with any key that is acceptable to you and/or other maintainers.

Ok, so no KEY_KBDILLUMTOGGLE then if that already is at Fn+F7

So lets stick with a KEY_PROG# option here,
note asus-nb-wmi already used PROG# for:

        { KE_KEY, 0x38, { KEY_PROG3 } }, /* Armoury Crate */
        { KE_KEY, 0x86, { KEY_PROG1 } }, /* MyASUS Key */
        { KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */
        { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
        { KE_KEY, 0xBD, { KEY_PROG2 } }, /* Lid flip action on ROG xflow */
Quoted 3 lines

I guess you checked that this laptop does not send the 0x83 / "Armoury Crate" events? What about 0x86 / "MyAsus"? If there is no MyAsus key I would prefer to use KEY_PROG1 here.

Quoted 8 lines

That is sent by this laptop as Fn+F12, which is why I started at PROG2.

Quoted 2 lines

Or you can add a KEY_FN_SPACE to input-event-codes.h grouping it together with the existing Fn + X combos there.

I wasn't sure how big of a deal adding new KEY_ values is. If that isn't too much of a hassle, I can do that and that takes care of Fn+space/f consistently.

It shouldn't be too much of a hassle and it indeed would be consistent, so that sounds good.

Quoted 20 lines
Quoted 20 lines
Quoted 7 lines
Quoted 4 lines

drivers/platform/x86/asus-nb-wmi.c static const struct key_entry asus_nb_wmi_keymap[] = { · line 628

Quoted 2 lines
drivers/platform/x86/asus-nb-wmi.c +1 -0
+	{ KE_KEY, 0xCA, { KEY_F14 } }, /* Noise cancelling on Expertbook B9 */

KEY_SOUND ?

Can do, but then what about the fn+ version? Ideally they should be related.

Hmm, can use KEY_PROG3 + KEY_PROG4, assuming that the Fn+ spacebar becomes KEY_PROG1 and that KEY_PROG3 / PROG4 are otherwise free ?

If not then why start at KEY_F14 and not at KEY_F13, does this laptop's keyboard has a key which sends:

        { KE_KEY, 0x71, { KEY_F13 } }, /* General-purpose button */

Also are there no conflicts with some of the other entries which send F14 / F15 ?

Quoted 7 lines
Quoted 2 lines

As in no other keys which generate the existing codes mapped to F13 / F14 / F15 ?

The reason I picked F14 is that the key is physically located two keys to the right of F12.

do either F13/F14, or PROG2/3.

Lets do F13/F14 then.

Quoted 20 lines

For posterity, here's a list of all codes sent by this laptop:
* {up,down,left,right}: ACPI button/{up,down,left,right} (in addition to normal ATK event)
* fn-{up,down,left,right}: ATK {PgUp,PgDown,Home,End}
* copilot key (right of AltGr): ATK shift+win+F17
press+release (immediately, releasing the physical key does nothing)
* fn-lctrl: ATK compose (menu)
* fn-space: WMI unknown key 0x5b
* fn-b: ATK pause (scancode 0xc5)
* fn-p: ATK pause (scancode 0xc6)
* fn-k: ATK scrolllock
* fn-f: WMI unknown key 0x9d (supposed to be "asus intelligent performance")
* fn-a: no event visible anywhere
* fn-esc: toggles between fn/f keys being primary, sends no visible keys except ACPI event
* fn-(1-4): WMI scancode 0x61-0x64 (switch video mode);
also ACPI video/switchmode event identical for all 4 keys
* fn-(f1/f2/f3): ATK mute/voldown/volup + ACPI button/{mute,volumedown,volumeup}
* fn-f4/f5: ACPI brightness down/up
* fn-f6: WMI scancode 0x6b - F21
* fn-f7: keyboard backlight, sends no visible keys anywhere except ACPI event

Quoted 8 lines

* fn-f8: ATK win+p
* fn-f9: ATK win+l
* fn-f10: no event visible anywhere
* fn-f11: ATK win+shift+s
* fn-f12: WMI prog1 (scancode 0x86) + ACPI button/prog1
* mic-mute: WMI F20 (scancode 0xbe) + ACPI button/f20
* mic noise key (right of mic-mute): WMI scancode 0xca; fn- sends 0xcb
* fn-del: insert

Thank you.

Regards,

Hans