Skip to content

Add macro key support (P1-P6) for HP Omen laptops#3

Open
kabanendenis wants to merge 1 commit into
ranisalt:rebase-6.15from
kabanendenis:add-macro-keys
Open

Add macro key support (P1-P6) for HP Omen laptops#3
kabanendenis wants to merge 1 commit into
ranisalt:rebase-6.15from
kabanendenis:add-macro-keys

Conversation

@kabanendenis

Copy link
Copy Markdown

Summary

This PR adds support for the P1-P6 programmable macro keys found on HP Omen gaming laptops.

Changes

  • Add HPWMI_MACRO_PROFILE_SET (0x0F) and HPWMI_MACRO_MODE_SET (0x17) WMI commands
  • Add macro_profile_bytes array that maps P1-P6 keys to numpad 1-6 (KP1-KP6)
  • Add macro_key_setup() and macro_key_remove() functions
  • Integrate into hp_wmi_bios_setup() and hp_wmi_bios_remove()

Key Mapping

Key Default Ctrl+ Alt+ Shift+ Fn+
P1 KP1 Ctrl+KP1 Alt+KP1 Shift+KP1 KP7
P2 KP2 Ctrl+KP2 Alt+KP2 Shift+KP2 KP8
P3 KP3 Ctrl+KP3 Alt+KP3 Shift+KP3 KP9
P4 KP4 Ctrl+KP4 Alt+KP4 Shift+KP4 KP0
P5 KP5 Ctrl+KP5 Alt+KP5 Shift+KP5 KP-
P6 KP6 Ctrl+KP6 Alt+KP6 Shift+KP6 KP+

Users can remap these keys using keyd, xbindkeys, or DE shortcuts.

Testing

  • Hardware: HP OMEN Laptop 17-ck0xxx (i9 + RTX 3080)
  • OS: ZorinOS (Ubuntu 24.04)
  • Kernel: 6.14.0-37-generic

All 6 macro keys work correctly.

Credits

Based on xddxdd/hp-omen-linux-module macro key implementation, ported to kernel 6.14+ API.

- Add HPWMI_MACRO_PROFILE_SET and HPWMI_MACRO_MODE_SET commands
- Add macro_profile_bytes array mapping P1-P6 to KP1-KP6
- Add macro_key_setup() and macro_key_remove() functions
- Integrate macro key initialization in hp_wmi_bios_setup/remove

This enables the P1-P6 programmable macro keys on HP Omen laptops.
Keys are mapped to numpad 1-6 by default.

Based on xddxdd/hp-omen-linux-module macro key implementation.
Tested on HP OMEN 17-ck0xxx with kernel 6.14.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant