6

Most code editors like IntelliJ, VSCode etc have many shortcuts using the 'option' key in mac. For me, using the option key would cause a special character to be printed instead of performing the shortcut. I wanted to turn this feature off.

I managed to do it after some googling. To serve as a documentation, I am answering my own question below.

4 Answers 4

8

This answer explains how to completely prevent Option+key from producing special characters, allowing you to use these combinations for shortcuts in VS Code and various other editors.

In short:

  1. Download this QWERTY keyboard layout file (or generate one yourself using the instructions in the linked answer).
  2. Move it to ~/Library/Keyboard Layouts/
  3. Go to System Settings > Keyboard > Text Input > Input Sources > Edit.
  4. Click + in the bottom left, scroll to the bottom of the list on the left and select Others then select QWERTY no option and click Add.
  5. Either delete your existing layout (probably called U.S.) or just switch to the QWERTY no option layout using the input-source select in the menu bar.
1
  • Thank you for the update! I am no longer using mac, so cannot confirm if this helps of not, but given the upvotes, seems correct :)
    – Somjit
    Commented Aug 8, 2023 at 3:57
5

Most code editors like IntelliJ, VSCode etc have many shortcuts using the 'option' key in mac. For me, using the option key would cause a special character to be printed instead of performing the shortcut.

How to fix this:

Go to system preferences > keyboard.

My Keyboard was set to 'ABC - extended'. Which had special characters turning up on pressing the 'option' key. I Changed the keyboard to 'ABC' , ie, one without the extension part.

Problem solved.

Why? Coz the 'ABC' keyboard doesnt have the special characters in them :)

1
  • 7
    ABC doesn't seem to work for me on MacOS 12. Still has the special characters. Commented Aug 26, 2021 at 16:59
5

I'm on Sonoma 14.2.1

  • Navigate to System Settings -> Keyboard
  • Under the Text Input section, click on the Edit button for Input Sources. A window will pop up to allow you to manage your input sources.
  • Click on the + button on the bottom-left corner, and a new popup will appear to ask you to choose a language.
  • Under Others (bottom of the list for me), there should be an option for Unicode Hex Input. This QWERTY layout has nothing mapped to the Option layer.
  • (Optional) I then removed my usual ABC keybaord.

enter image description here

Edit - I just noticed that Opt+ and Opt+ to move between words doesn't seem to work robustly. It behaves well in most text editing scenarios, but not in the URL bar for Google Chrome.

-1

Hex-Input works well for most users. However, for those who want to highly customize their keyboard keys, installing a tool like Karabiner-Elements is an excellent choice.

Karabiner-Elements allows for extensive customization of keyboard keys. To get started, you'll need to begin with the basics, but with some time and effort, you can achieve your preferred customizations.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .