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

Add Apple Fn / Globe key #20643

Closed
wants to merge 3 commits into from

Conversation

vinorodrigues
Copy link
Contributor

@vinorodrigues vinorodrigues commented Apr 30, 2023

Description

Modern macOS no longer locks out the use of the Apple Fn (🌐) key, thus allowing users to leverage this functionality in trade for NKRO. [ UPDATE: disproved > this is only true when the Karabiner-Elements driver is present]

Entirely based on @fauxpark 's Gist with 2 minor changes:

  • KC_APPLE_FN is now keycode 0x00C3 (since 0x00C1 is taken up by KC_MISSION_CONTROL)
  • qmk generate-keycodes did not generate the IS_APPLE_FN macro in keycode.h, I changed this for the auto-gen IS_APPLE_FN_KEYCODE.

No other attempt is made to change the code - meaning if one chooses to add the Apple Fn keys then one also needs to disable NKRO.

In lieu of docs

To compile:

Head on over to your keyboard keymap file and add the following two lines to the rules.mk file:

NKRO_ENABLE = no
APPLE_FN_ENABLE = yes

Add the KC_APFN keycode to the appropriate spot on the keymap.c file.

Fn/🌐 key combos to test on macOS Monterey & macOS Ventura

  • Fn+F - toggle full screen mode
  • Fn+Up / Fn+Down - Page scrolling
  • Fn+Right / Fn+Left - End of, and Start of document scrolling
  • Fn+E - Insert symbol or emoji
  • Fn+Q - Quick note
  • Fn + Delete - Forward delete (same as Contro-D)
  • Fn+F1..F12 - Media keys (should also work on macOS Catalina)
    • F1 - Main screen brightness down (for active screen use F14)
    • F2 - Main screen brightness up (for active screen use F15)
    • F3 - Mission Control
    • F4 - Launchpad
    • F5 - Underglow Down (obviously not on the QMK kb)
    • F6 - Underglow Up (obviously not on the QMK kb)
    • F7 - Previous Track
    • F8 - Play / Pause
    • F9 - Next Track
    • F10 - Mute
    • F11 - Volume Down
    • F12 - Volume Up

Will depend on your System Preferences > Keyboard

image

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation [TODO]

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. [TODO]
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label Apr 30, 2023
Copy link
Member

@tzarc tzarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave the rest of the functionality to others, but there's some inconsistencies that'll need to be sorted out regardless.

data/constants/keycodes/keycodes_0.0.2_basic.hjson Outdated Show resolved Hide resolved
quantum/action.c Outdated Show resolved Hide resolved
@drashna
Copy link
Member

drashna commented Apr 30, 2023

I'm curious as to why this implementation over the other:
https://github.com/jhorology/keyboards/blob/main/patches/qmk_00_applefn.patch

Which seems to work with NKRO (which, IMO, would be preferable)

@vinorodrigues
Copy link
Contributor Author

vinorodrigues commented Apr 30, 2023

why this implementation over the other

A couple of reasons:

  1. I didn't know of that one.
  2. I know fauxpark's work, but jhorology was not known to me
  3. That patch requires EXTRAKEY_ENABLE
  4. macOS has a few weirdnesses with NKRO - see:
  5. macOS does not use NKRO anyway (since it's own boards don't support it), and I made the assumption that anyone wanting this feature will compile a "to be used on macOS only" variation of the f/w

Having said that - I fully expect fauxpark to have his own take on this and I expect to close it anyway.
Other side if that coin ... I'm also happy to help. Docs need doing too.

@vinorodrigues
Copy link
Contributor Author

vinorodrigues commented May 1, 2023

After extensive testing [thanks @filterpaper, @drashna, @tzarc, @fauxpark] - it turns out that this still does not work without changing the VID/PID to one of Apple's keebs.

This is however not the case if Karabiner-Elements is installed .. in which case any VID/PID will work. As this dependence sits outside of QMK, and it's alternative (to spoof an Apple keeb) leaves makers legally exposed, it thus makes no sense to add this to core as it would not work for the general consumer. Closing PR draft.

(For now, fauxpark/applefn.patch remains the goto.)

@mpicardvolvo
Copy link

Question about how to use this, I don't see it mentioned in the QMK docs anywhere, I am relatively beginner so I only now how to use the QMK Configurator online, and I don't see this key as an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants