Skip to content

W-433: Replace the system emoji picker (⌃⌘Space + Globe key)#149

Merged
wr merged 1 commit into
mainfrom
wells/w-433-replace-system-emoji-picker-space-globe-key-open-mojito
Jun 26, 2026
Merged

W-433: Replace the system emoji picker (⌃⌘Space + Globe key)#149
wr merged 1 commit into
mainfrom
wells/w-433-replace-system-emoji-picker-space-globe-key-open-mojito

Conversation

@wr

@wr wr commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Points ⌃⌘Space and a lone Globe/Fn key tap at Mojito's emoji browser instead of the macOS Emoji & Symbols panel. Opt-in, surfaced as a Raycast-style row in Quick Access settings and an onboarding step.

What's in it

  • Panel replacement — the browser hotkey claims ⌃⌘Space (via KeyboardShortcuts), and the OS panel is best-effort suppressed through the private SkyLight CGSSetSymbolicHotKeyEnabled (hotkey 50), resolved by dlsym so a missing symbol no-ops instead of crashing.
  • Globe key — a lone fn down→up under 300ms with no intervening key fires the browser, detected on KeyMonitor's existing flagsChanged stream. AppleFnUsageType=0 hands the key over (needs a logout to fully apply — surfaced in the UI); prior value stashed and restored on disable.
  • Two independent toggles — "Replace System Picker" claims ⌃⌘Space + the Globe key in one tap; reset restores the ⌃⌥Space default; the Globe key is also toggleable on its own.
  • Custom ShortcutRecorder — the KeyboardShortcuts library's Recorder misbehaved in this app (keys leaked into the field editor, chords didn't register), so this captures via keyDown on the responder chain. Native text-field styling + focus ring, a clear (X) button, click-away/Escape dismiss. Reused for the pause-hotkey fields too.
  • The event tap is suspended while the Settings window is key so it doesn't fight the recorder for keystrokes.
  • The hotkey toggles the browser (a second press closes it), matching the panel.

Test plan

  • ⌃⌘Space and the Globe key both open the browser (IRL-confirmed); a second press closes it.
  • Settings: Replace → claims ⌃⌘Space + Globe; reset → ⌃⌥Space default + restores panel/Globe; Globe toggle works independently.
  • Recorder: click to record, capture a chord, clear with X, dismiss with Escape / click-away; no key leakage.
  • Pause-hotkey recorders capture correctly with the new control.
  • Unit suite green (scripts/run-tests.sh).

Notes / risk

  • Private CGS API: no notarization impact (Developer-ID, non-sandboxed); every call guards its return, so OS churn renumbering the hotkey ID just no-ops.
  • Globe takeover needs a logout to stop the OS panel; ⌃⌘Space is immediate and self-heals (CGS state resets each login).

Refs W-433

Adds an opt-in feature that points ⌃⌘Space and a lone Globe/Fn key tap at
Mojito's full-library emoji browser instead of the macOS Emoji & Symbols panel.
Surfaced as a Raycast-style row in Quick Access settings plus an onboarding step.

Split into two independent concerns:
- Panel replacement: the browser hotkey owns ⌃⌘Space (registered via
  KeyboardShortcuts on the showEmojiBrowser Name) and the OS panel is
  best-effort suppressed via the private SkyLight CGSSetSymbolicHotKeyEnabled
  (hotkey 50), resolved by dlsym so a missing symbol no-ops instead of crashing.
- Globe key: a lone fn down→up under 300ms with no intervening key fires the
  browser. Detected on KeyMonitor's existing flagsChanged stream. AppleFnUsageType
  is set to 0 so the OS stops claiming Globe (needs a logout to fully apply,
  surfaced in the UI); the prior value is stashed and restored on disable.

Settings UI:
- A "Replace System Picker" button claims ⌃⌘Space + the Globe key in one tap;
  reset restores the ⌃⌥Space default; the Globe key is also its own toggle.
- ShortcutRecorder: a purpose-built NSViewRepresentable recorder. The
  KeyboardShortcuts library's Recorder misbehaved here (keys leaked into the
  field editor, chords didn't register), so this captures via keyDown on the
  responder chain. Native text-field styling + focus ring, a clear button, and
  click-away/Escape dismiss. Also reused for the pause-hotkey fields.
- The CGEventTap is suspended while the Settings window is key so it doesn't
  compete with the recorder for keystrokes.

The hotkey toggles the browser (a second press closes it), matching the panel.

Refs: W-433
@linear-code

linear-code Bot commented Jun 26, 2026

Copy link
Copy Markdown

W-433

@wr wr merged commit aab75d9 into main Jun 26, 2026
8 of 10 checks passed
@wr wr deleted the wells/w-433-replace-system-emoji-picker-space-globe-key-open-mojito branch June 26, 2026 03:59
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

Successfully merging this pull request may close these issues.

1 participant