How to solve Alt key binding issue on macOS?

Sun, 16 Apr 2023 02:40:48 GMT

Solution for binding Alt + {key} hotkeys.

Problem

If you are using macOS, you can experience this issue each time you press any hotkey which contains Options.

For example, Options + a will print å in your text editor.

Root cause

Those output characters is pre-defined by the keyboard input method.

Almost users use the U.S keyboard layout which cause this issue.

Solution

1. All apps:

Change the keyboard input method. You can try this keyboard input method: Unicode Hex Input.

2. Alacritty 0.12+:

Add this option to your Alacritty config:

window:
  option_as_alt: OnlyLeft # other values are None, OnlyRight, Both


window:
  option_as_alt: OnlyLeft # other values are None, OnlyRight, Both