ukbd, hkbd, evdev: fix apple "magic" keys #1998
Open
+191
−61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I recently acquired 3 old Macbooks (MBP 8,3, MBA 6,1, MBA 7,2) and the Fn, Eject & Multimedia keys did not show up in the output of
kbdscan,evtestorxevor do anything but provideF1..F12whetherFnwas held or not.This PR fixes that and adds sysctls for toggling whether or not holding Fn is required to access the Multimedia keys.
I'm curious why we're looking for the Apple vendor usage page at
0xFFFFrather than the locations Linux looks for it? I found it at0x00FFon all 3 machines. I've left0xFFFFin there as I'm assuming it was set to that for a good reason and works on Apple hardware that Linux no longer supports.I've also added a
sysctlforukbd&hkbdto toggle the mode of the function keys similar to what's available on Linux, but would like to make a more convenient toggle via Fn+Esc at some point...Finally, one of the main motivations for this work was to get extra keys to bind to my desires in userland which is why I've "unhidden" the Fn and Eject keys. I chose
KEY_WAKEUPfor Fn, asKEY_FNdoesn't make it to X, andXF86WakeUpcommonly shows up on the Fn key back in penguin land...