amarsyla / hidutil-key-remapping-generator

Simple tool to generate HIDUTIL key remapping configurations for MacOS
https://hidutil-generator.netlify.app/
256 stars 17 forks source link

Please add support for special keys. #33

Open binn opened 1 year ago

binn commented 1 year ago

Please add support for the M1 Macbook Special keys, e.g. Spotlight, Launchpad, Mission Control.

image

binn commented 1 year ago

After looking through the sources of some other applications, I managed to find this

namespace apple_vendor_keyboard {
constexpr value_t spotlight(0x0001);
constexpr value_t dashboard(0x0002);
constexpr value_t function(0x0003);
constexpr value_t launchpad(0x0004);
constexpr value_t reserved(0x000a);
constexpr value_t caps_lock_delay_enable(0x000b);
constexpr value_t power_state(0x000c);
constexpr value_t expose_all(0x0010);
constexpr value_t expose_desktop(0x0011);
constexpr value_t brightness_up(0x0020);
constexpr value_t brightness_down(0x0021);
constexpr value_t language(0x0030);
} // namespace apple_vendor_keyboard

I'm not sure if it'll be of use, I found this from https://github.com/pqrs-org/Karabiner-Elements and this https://eastmanreference.com/complete-list-of-applescript-key-codes

gregbook commented 1 year ago

Depending on your keyboard (topcase/external/vendor) and macbook model these will vary, adapt based on your needs/hardware. Hope this helps.

Media Control Keys Hex code
display_brightness_decrement 0x0C00000070 or 0xFF0100000021 or 0x00FF00000005
display_brightness_increment 0x0C0000006F or 0xFF0100000020 or 0x00FF00000004
launchpad 0x0C000002A2 or 0xFF0100000004
mission_control / expose 0xFF0100000010
spotlight 0x0C00000221 or 0xFF0100000001
dictation 0x0C000000CF
do_not_disturb 0x010000009B
keyboard_brightness_decrement 0xFF00000009
keyboard_brightness_increment 0xFF00000008
rewind 0x0C000000B4
play_or_pause 0x0C000000CD
fast_forward 0x0C000000B3
volume_decrement 0x0C000000EA
volume_increment 0x0C000000E9
dashboard 0xFF0100000002

Apple HID Usage Tables

USB HID Usage Tables

Sources:

Tecon commented 3 months ago

@gregbook thanks, very useful for me, I have tried long to find a simple way to remap launchpad(fn + F4) to volume up(fn + F12) while keeping f-key as it's own, BetterTouchTool and Karabiner-Elements can make it, but I don't want to install additional software. It wasn't resolved until I saw your reply.

Thanks Again!