Skip to content

Instantly share code, notes, and snippets.

@lordpixel23
Last active May 26, 2025 18:26
Show Gist options
  • Save lordpixel23/87498dc42e328eabdff6dd258a667efd to your computer and use it in GitHub Desktop.
Save lordpixel23/87498dc42e328eabdff6dd258a667efd to your computer and use it in GitHub Desktop.
Adding support for Apple fn/Globe key to QMK

What this does

This allows you to define a key for your QMK keyboard which has some of the same functionality as the fn/Globe key on an Apple keyboard. Applying the following patch to your qmk repository creates a new keycode KC_GLOBE which can then be used in your keymaps.

Where is this from

This commit is updating @drashna's code from Nov 2023 to work with the Nov 2024 files.

How to

  1. Apply the changes from this commit in full
  2. Make sure rules.mk for your keyboard has KEYBOARD_SHARED_EP = yes or else Globe-E, Globe-Q etc. will not work.
  3. Use KC_GLOBE in your keymap to define a key as the fn/Globe key and compile as normal.

Alternatively if you want to avoid patching the generated header file, replace step 1. above with:

  1. Create thre new JSON file data/constants/keycodes/keycodes_0.0.4_basic.hjson from the commit above
  2. Run qmk generate-keycodes -v 0.0.5 -o quantum/keycodes.h in the root of the repo to update the keycodes
  3. Apply the change to tmk_core/protocol/report.h from the commit above

Caveats

This will not make the key behave fully like the key on an Apple keyboard. Specifically more is required if you want it to toggle between F1โ€“F12 and controlling brightness etc. See @fauxpark's gist for the long details.

@ChrisGVE
Copy link

Well, that's an idea. Let me consider how much effort that would require (there's documentation to be updated as much as code). If we don't go up to faking Apple's IDs but just implement a key, I could try to publish the fix in a pull request. But no promises and the maintainers could also object.

@ChrisGVE
Copy link

I've created a pull request with @lordpixel23 changes, only added a compilation flag and updated the documentation. Credit goes to @lordpixel23 and other contributors such as @fauxpark.
Now that it is done, I'll try to resolve all the kinks that will likely pop up with the pull request.

@avsej
Copy link

avsej commented Dec 2, 2024

After all, it is a way for Apple to differentiate from the competition
Microsoft is also trying to introduce new key on the keyboard (as if Windows logo is not enough on the most keyboards in the world)

https://blogs.windows.com/windowsexperience/2024/01/04/introducing-a-new-copilot-key-to-kick-off-the-year-of-ai-powered-windows-pcs/

@ChrisGVE
Copy link

ChrisGVE commented Dec 2, 2024

Lovely! I see there will be new keycodes to map in the future...

@Ostrichbeta
Copy link

I followed the gist to modify my Keyboard(Keychron K10 Pro)'s config and it works in cable mode, but the globe key just failed in Bluetooth mode, that's strange.

@DerekOverlock
Copy link

DerekOverlock commented Feb 13, 2025

@Ostrichbeta - I just ran into the same thing. I've mapped the globe key to a key on my Nuphy Halo96v2, it works as expected when it's connected via wire... but fails w/ Bluetooth or 2.4Ghz RF. Have you had any luck with this?

I've downloaded the Key Codes app from the Mac App Store to see the logged keypresses and they look identical between the Nuphy key in BT mode, the Nuphy key in wired mode, and when I press the real globe key on my MacBook Pro:
Screenshot 2025-02-14 at 10 44 11

@quxin5605
Copy link

@Ostrichbeta - I just ran into the same thing. I've mapped the globe key to a key on my Nuphy Halo96v2, it works as expected when it's connected via wire... but fails w/ Bluetooth or 2.4Ghz RF. Have you had any luck with this?

I've downloaded the Key Codes app from the Mac App Store to see the logged keypresses and they look identical between the Nuphy key in BT mode, the Nuphy key in wired mode, and when I press the real globe key on my MacBook Pro: Screenshot 2025-02-14 at 10 44 11

I have the same problem with my nuphy air75_V2๐Ÿ™ˆ

@ChrisGVE
Copy link

ChrisGVE commented Apr 7, 2025

I followed the gist to modify my Keyboard(Keychron K10 Pro)'s config and it works in cable mode, but the globe key just failed in Bluetooth mode, that's strange.

I've modified the Keychron firmware for my Q60 Max, and the globe key works for both wired and bt (I just rechecked now to make sure). To be complete, I'm using their firmware on their wireless_playground branch which is my basis for the Q60.

@jzw95
Copy link

jzw95 commented May 9, 2025

it works as expected when it's connected via wire... but fails w/ Bluetooth

@quxin5605 I'm having the exact same issue as you with a Keychron K4 Pro. Works in wired but not bluetooth mode, even though the Key Codes app shows the exact same info for both. Did you ever get this working in bluetooth mode? @ChrisGVE are you able to share your modified files that result in the Globe key working in bluetooth mode for your Q60 Max? I essentially never use wired mode, so really need to get the globe key working on bluetooth!

To clarify, the Globe shortcuts work on bluetooth (e.g. Globe+N opens Notification Centre), but pressing and releasing Globe does not bring up the emoji picker. This is the key feature I use many times a day. ๐Ÿ™‚

@ChrisGVE
Copy link

ChrisGVE commented May 9, 2025

Yes, sure: you can go to my repo qmk_keychron and use the branch "wireless_playground_apple" which contains the changes. If you'd like to check the compilation, you may also use my userspace repo and compile qmk compile -kb keychron/q60_max/ansi -km chrisgve. Let me know if you encounter problems, and I can guide you.

I have no credit for making it work on BT, though. This is only due to the work of Keychron and their implementation, and I must admit that it is beyond my level to understand what they have done. Note also that it's a trimode keyboard, but I am not using it with the USB receiver (I'm not even sure where it is).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment