question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option keys not usable as mappings on macOS

See original GitHub issue

On macOS the alt/option key is used as a second shift like key: one can enter special characters as ∂, ƒ, ¬, ø (option+d, option+f, option+l, option+o). Problematic are the keys option+\``, option+e, option+u, option+i, option+n which are dead keys to compose diacritics like è, é, ë, ê and ñ. These can’t be used to map Kakoune/Dance chords.

This solution only adds support to use option as meta in the terminal emulator of VSCode. Using something like this in the editor is currently not supported and should probably be fixed in core VSCode.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
71commented, Oct 3, 2022

Reviving this – I’m working on updated keybindings for Dance on Mac (and for alternative keyboard layouts). Given that the user will have a set-up step where they’ll choose their layout and OS, what do you think should be changed to make Dance friendlier to macOS? Ideally we wouldn’t need system-wide changes or Karabiner.

0reactions
bfulopcommented, Feb 6, 2022

I wanted to share my workaround:

I’m using Karabiner to remap option to control-option and updated all the shortcuts in VScode.

In the end I went even further. I remapped spacebar to control-option when pressed together with another key and to space when pressed alone.

Here’s what the setup looks like in Karabiner Elements.

{
                        "description": "Change spacebar to control+alt in VScode for Dance actions",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "bundle_identifiers": [
                                            "com\\.microsoft\\.VSCode",
                                            "com\\.microsoft\\.VSCodeInsiders"
                                        ],
                                        "type": "frontmost_application_if"
                                    }
                                ],
                                "from": {
                                    "key_code": "spacebar",
                                    "modifiers": {}
                                },
                                "parameters": {
                                    "basic.to_if_alone_timeout_milliseconds": 240,
                                    "basic.to_if_held_down_threshold_milliseconds": 5
                                },
                                "to_if_alone": [
                                    {
                                        "key_code": "spacebar"
                                    }
                                ],
                                "to_if_held_down": [
                                    {
                                        "key_code": "left_control",
                                        "modifiers": ["left_option"]
                                    }
                                ],

                                "type": "basic"
                            }
                        ]
                    }

In my experience this is what the timeouts mean:

basic.to_if_alone_timeout_milliseconds → the maximum time you have to finish pressing and then releasing the spacebar to be registered.

basic.to_if_held_down_threshold_milliseconds → the minimum time the spacebar has to be pressed down to be considered as a modifier key. If you press the second key sooner than this timeout, it will not work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modifier Key Mapping Not Working - Apple Community
I choose "USB Receiver" from the keyboard drop-down, re-map the Option and Command keys, click OK, and close SysPrefs. Nothing has changed; the ......
Read more >
How to re-map command and option keys on Mac OS X with a ...
The answer was as easy as this: Click the Apple logo in the top left of your screen; Select "System Preferences"; Select "Keyboard" ......
Read more >
Full list of option key mappings in Mac keyboard - Ask Different
You can easily see how all the keys are mapped with Apple's Keyboard Viewer.
Read more >
Certain key mappings not working in MacVim - Stack Overflow
Investigate the cause by doing :verbose map <D-Up>. Additionally try selectively enabling your other plugins to see whether mappings are ...
Read more >
How to Use a Windows PC Keyboard on Mac by Remapping ...
Click the dropdown next to “OPTION Key” and select “Command” Click the dropdown next to “COMMAND Key” and select “Option”
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found