Skip to content

C-SPC bindings do not work on macOS as it conflicts with the input source switching shortcut #8740

@skkzsh

Description

@skkzsh

Problem

On macOS, Control + Space is reserved by the system as a shortcut for switching input sources (IME).
This affects users who type in languages that require an IME, such as Japanese, Chinese, and Korean.
Because this key combination is intercepted at the OS level, it never reaches Emacs, making all of Doom's C-SPC bindings inaccessible.

Affected bindings

Doom Emacs maps C-SPC in several places , including:

"C-SPC" #'+vertico/embark-preview

(consult-customize
consult-ripgrep consult-git-grep consult-grep
consult-bookmark consult-recent-file
consult-source-recent-file consult-source-project-recent-file consult-source-bookmark
:preview-key "C-SPC")

:m "C-SPC" #'org-agenda-show-and-scroll-up

Question

Is there an officially recommended way to work around this conflict,
or would it be possible to provide an alternative default binding for macOS users?

As a stopgap, I found that adding the following to the config remaps another key to C-SPC:

(when (featurep :system 'macos)
  (keymap-set key-translation-map "C-:" [?\C-\ ])
  )

Steps to reproduce

  1. On macOS, enable a CJK input source (e.g. Japanese, Chinese, or Korean) in System Settings → Keyboard → Input Sources.
  2. Confirm that Control + Space is assigned as the input source switching shortcut in System Settings → Keyboard → Keyboard Shortcuts → Input Sources.
  3. Open Doom Emacs and try pressing C-SPC (e.g. in a vertico buffer to preview).
  4. The key combination is intercepted by macOS and never reaches Emacs.

System information

https://pastebin.com/D91vKSzA

Disclosures

  • This issue was written with/by AI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    os:macOSPertains specifically to MacOSre:keybindsChanges to or discussion about Doom's keybinds

    Type

    Open to PRs

    No

    Priority

    None yet

    Projects

    Status
    Blocked

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions