qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
17.8k stars 38.15k forks source link

[Question] Is there a way of making a Fn key for OS X? #378

Closed jtbandes closed 8 years ago

jtbandes commented 8 years ago

The default ErgoDox EZ firmware has keys for both ⌫ and ⌦. Having both of these available is nice, but I don't need separate keys for them. On Apple keyboards there is a "fn" key, and pressing fn+⌫ is the same as ⌦. The fn key also affects the behavior of F1–F12, making them "pure" function keys for programs to interpret, instead of activating special features like brightness adjustment.

But I can't figure out how to add a fn key to my keymap. I didn't see any "modifier"-like constant defined for it, and xev doesn't show any events when it's pressed/released. However, the OS X "Keyboard Viewer" is able to show when the fn key is pressed and released, and the "EventViewer" included in Karabiner shows a FlagsChanged event with code 0x3f for the fn key.

Does anyone know if there's a way to do this, or should I just "fake it" using a custom layer that has the keys I want?

jtbandes commented 8 years ago

I also just noticed another issue that might be somewhat related. On Apple keyboards, holding shift while pressing the volume up/down keys will disable the auditory feedback for the volume change. But for some reason, on the ErgoDox, holding shift while pressing KC_VOLU or KC_VOLD doesn't have the same effect.

jackhumbert commented 8 years ago

Unfortunately the Fn key is limited to the Apple keyboards, and keyboards that directly emulate apple keyboards - this isn't something that's currently possible with the firmware. It'd be easiest to try to emulate the functionality with additional layers.

I'm not sure why the shift wouldn't modify the volume sounds, but my guess is it's related to the above. I don't know of a workaround for that :/

jtbandes commented 8 years ago

Holding shift seems to work now...either I was confused or something mysterious has changed. Anyway, thanks for the response. I was hopeful that whatever Karabiner was able to detect would be something the keyboard could produce, but perhaps not. (Or maybe someone cleverer than me could figure it out by intercepting events from an Apple USB keyboard and trying to emulate those...)

ezuk commented 8 years ago

Looks like this is as resolved as this is going to get! :) Closing it for now. Thanks @jackhumbert and @jtbandes