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

macOS: Ctrl+L with Ergo-L keyboard layout doesn't produce a ctrl encoding #5448

Open
mitchellh opened this issue Jan 31, 2025 · 2 comments
Open
Labels
input Keyboard or mouse input os/macos

Comments

@mitchellh
Copy link
Contributor

Steps to reproduce:

  1. Install Ergo-L: https://ergol.org
  2. Launch Ghostty
  3. Run any keyboard input tracker, i.e. kitty +kitten show_key -m kitty (or any other)
  4. Switch to Ergo-L
  5. Ctrl+L (On US physical: Ctrl+H)

Notice the control key doesn't show up.

I've tracked this down to the code below, but this code exists for a reason. We should investigate why we do this, fix this, and ensure we don't regress the reason we did this in the first place.

// This is a hack. libghostty on macOS treats ctrl input as not having
// text because some keyboard layouts generate bogus characters for
// ctrl+key. libghostty can't tell this is from an IM keyboard giving
// us direct values. So, we just remove control.
var modifierFlags = event.modifierFlags
modifierFlags.remove(.control)

@guidoschmidt
Copy link

guidoschmidt commented Feb 1, 2025

The line you mention above (modifierFlags.remove(.control)) actually also removes all kind of Ctrl + key combinations for me, e.g. writing zig b and use Ctrl + e to accept the auto completion to zig build. Or using Ctrl + w to remove the previous word.

Commenting out that line and doing a fresh build solved that for me, so seems to be not only related to Ergo-L. But as you mentioned, probably the removal of Ctrl had some purpose?

Though I'm actually using a Capslock key mapped onto Tab, you can set that up in macOS System Settings via Customise modifier keys.

@aurelberra
Copy link

Hello! I am using Ergo-L on macOS and I can confirm that I have lost all the usual Ctrl shortcuts in Ghostty with the latest update: Ctrl+a, Ctrl+e, Ctrl+c, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
input Keyboard or mouse input os/macos
Projects
None yet
Development

No branches or pull requests

3 participants