Search code examples
macoskeyboardkeyboard-shortcutsmacos-big-sur

How to disable generating special characters when pressing the `alt+a`/`option+a` keybinding in Mac OS (`⌥+a` )?


There is a behavior in my mac that I'm trying to disable.

When I'm in any text editor and typing a key combination using the alt/option+any letter, the output will be special characters.

For example:
the combination alt+a will generate å.
the combination alt+x will generate .

I want to cancel this behavior.
I'm a programmer and when I use my code editor I want to map some keybinding (keyboard shortcuts) to the alt key (⌥+a for example) but when I do that it doesn't execute because it generates the special characters.
I guess that the special character has a priority over my code editor shortcuts.

Do you know how can I disable this default behavior?


Solution

  • I was having the exact same problem, in the exact same IDE.

    The solution to this is to download Ukulele from here:

    http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ukelele

    In the application you can create a new keylayout using File -> New from current source. Pressing Option will show you in the place for Option-b a red colored key - meaning it's a dead key. Double clicking it will allow you to change it from a dead key to an output key. When prompted for the output you can put in the same thing (by pressing Option-b).

    Thus it will output the same character but will not be considered a dead key, so Intellij can bind it as a shortcut.

    To enable your new layout you must save it into your ~/Library/Keyboard Layouts (it helps if you give it a new name with Keyboard -> Set Keyboard Name), and then enable it from System Preferences -> Language & Text.