Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Here's a simpler way to remap the home button to escape #5

Open
szhu opened this issue Dec 20, 2020 · 0 comments
Open

Here's a simpler way to remap the home button to escape #5

szhu opened this issue Dec 20, 2020 · 0 comments

Comments

@szhu
Copy link

szhu commented Dec 20, 2020

Hi, thank you so much for making this repo. I have spent way too many hours researching how to remap the home button to escape before finally coming across your program, which does exactly that. (In case how you're wondering how I found this repo, my path was Google -> Ask Different -> this repo.)

I want to point out that there's a simpler way to handle remapping, using Apple's hidutil. Apple has a Technical Note describing the usage: https://developer.apple.com/library/archive/technotes/tn2450/_index.html. Note that mappings created this way only persist until logout. (Someone made https://github.com/amarsyla/hidutil-key-remapping-generator as a way to create a LauchAgent to re-map using hidutil on login.)

This command will properly remap home button to escape:

 hidutil property --set '{"UserKeyMapping": [{"HIDKeyboardModifierMappingSrc": 0x0C00000223, "HIDKeyboardModifierMappingDst": 0x700000029}]}'

I saw many references to hidutil early on into my research, but spent hours finding the key code for the home button. Thanks to the code in your repo, I was finally able to find the correct Src key code. (0x0C00000223 = kHIDPage_Consumer << 32 | kHIDUsage_Csmr_ACHome)

I'm creating this issue in case it's useful to anyone else looking at the repo. I'm not necessarily suggesting that you replace your code with the line above, although you can if you want. Thank you so much again!

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

No branches or pull requests

1 participant