Menu Button Support on Windows Keyboard

Describe the bug
I bought a new windows ergonomic keyboard and BTT doesn't recognize the "menu" button on the left side of the keyboard. It's located between the control and windows buttons. The menu button symbol looks like a rectangle with three horizontal lines inside it.

Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.):
Windows Ergonomic Keyboard: Buy Microsoft Surface Ergonomic Keyboard 4000 - Microsoft Store

Screenshots
If applicable, add screenshots to help explain your problem. (You can just paste or drag them here)
Screen recording attached. Steps to reproduce:

  1. Open btt
  2. Create new recording
  3. Click the input field to record keystrokes
  4. Press the "menu" button on the keyboard

Result:

  1. The input field goes grey but the keystroke is not captured

Device information:

  • Type of Mac: Macbook Pro
  • macOS version: 11.6
  • BetterTouchTool version: 3.609

Additional information (e.g. StackTraces, related issues, screenshots, workarounds, etc.):

Any chance of getting this fix on the roadmap?

sorry, I don‘t own such a keyboard, so it’s currently unlikely. Do other apps capture that key? It might be possible it’s some proprietary thing, which is either used internally on the keyboard or requires some special software. BTT currently only captures keys that act as normal keyboard keys.

I beleive the key in question is the standard Windows Menu key (Menu key - Wikipedia). On my bog standard Dell keyboard the 'Key Codes' app produces the following...

Unicode: 16 / 0x10
Key Code: 110 / 0x6e

Hopefully those are enough to add support to BTT. It would be great to finally put a key I have never used (even in Windows) to some use!

If it's the normal menu key, you might be able to run this terminal command:

/usr/bin/hidutil property --set '{"UserKeyMapping":[
    {
        "HIDKeyboardModifierMappingSrc": 0x700000065,
        "HIDKeyboardModifierMappingDst": 0x70000006b
    }
]}'

This would remap the key to F16, which you can then configure in BTT.

However you'd need to run this command everytime macOS restarts, but this could be done using BTT's "After Launching BTT" action:

Fabulous, thank you!

It works, but on standard PC keyboards 'Print Screen / System Request' already maps to F13. 'Scroll Lock' and 'Pause / Break' are F14 and F15. I have found using 0x70000006b for 'HIDKeyboardModifierMappingDst' maps to F16 instead.

Any ideas why the values required here don't match those reported by Key Codes?

The codes used by the hidutil are on a lower level I think. You can get a list here Technical Note TN2450: Remapping Keys in macOS 10.12 Sierra (apple.com)

(it's always 0x7000000 followed by the code listed on the website, so you can map to any other code listet there as well)

Thanks guys! Super helpful. Got it working. :+1:

1 Like