Now it "outdents." There are a few other potentially related oddities, such as Command-[ causing the text to get smaller, and Command-] causing the text to get larger.
If I had to guess, someone change the key-mapping code to work off of key codes and not characters, so it think it's using a QWERTY keyboard, even though it's not.
This worked prior to the latest update (broken version is 0.10.5 dfc08dc9edf6607483b193bf934d3badc3fa2e11).
I have this exact same problem! The keybindings.json tells me i have to use a different shortcut for my current keyboard layout (cmd+z) but that does not work (it still undo's). Changing my keyboard layout does not work either, the keybindings.json comes up with different but still wrong suggestions.
@erichocean @mathiasvr Sorry about that!
This might be caused by our code that work arounds Chromium's implementing a w3c section only on Mac: https://github.com/Microsoft/vscode/blob/39602b3adbb50945fd8fe70017a2ffbd3000a477/src/vs/workbench/services/keybinding/electron-browser/nativeKeymap.ts#L204
How can I try to reproduce on a qwerty keyboard? is there a dvorak kb layout setting on the mac (I'm not usually working on a mac)?
Yes i'm actually on a physical qwerty keyboard as well, in keyboard settings you can add dvorak as input source.
@erichocean @mathiasvr There is indeed a difference between 0.10.4 and 0.10.5
The difference is that starting with 0.10.5 we have code in that reverts a questionable feature implemented by Chromium only on the mac -- B.2.4 Optionally fixed virtual key codes. This is in the w3c spec to support "legacy content expecting US-English keyboard layout", which is not the case with VS Code. We had to revert this feature because it caused keyboard input to be unreliable -- please see #1302 for an example on how this issue manifests itself.
I have checked on @isidorn mac that we do the right thing. i.e. when you open the default keybindings we inform that you must press cmd+z to get the comment line toggle.

Please read further about different keyboard layouts in the documentation
https://code.visualstudio.com/docs/customization/keybindings#_keyboard-layouts
Also, what would be needed to give a better user experience would be to be able to contribute keybindings based on keyboard layouts as asked in #1240
@alexandrudima The screenshot you posted is incorrect. Command-Z on the Mac is "Undo". Seriously, try it: it'll run the Undo command, not the editor.action.commentLine command as is implied by the pop-up.
That said, I was able to follow the other links and revive the main commands I was missing, in a custom keybinding.json file that looks like this:
[
{
"key": "cmd+[",
"command": "editor.action.commentLine",
"when": "editorTextFocus"
},
{
"key": "cmd+-",
"command": "editor.action.outdentLines",
"when": "editorTextFocus"
},
{
"key": "cmd+=",
"command": "editor.action.indentLines",
"when": "editorTextFocus"
}
]
That's all I needed to get back to normal productivity in the editor. Thanks!
P.S. Since someone went through all the effort to figure out that the key commands are wrong and display the custom UI gizmo, why not just fix them? I mean, if I can do it manually…why not just do it automatically? The editor is basically broken right now without the manual fixes. You can still display the correct key-sequence in the UI (now that you've got the code to do that…).
@erichocean I will look again into this as soon as I get my hands on a mac.
It looks like VSCode tries to preserve the _physical_ shortcut key. The toggle line comment shortcut is cmd+/. If you press the physical / key on a QWERTY keyboard that uses the Dvorak layout you get z. VSCode tries to map the shortcut to cmd+z, which doesn't even work since Undo binds higher.
This is why rebinding to cmd+[ works. On a physical QWERTY keyboard [ is mapped to /. By mapping the physical [ key I get the desired shortcut (cmd+/).
I don't think the shortcuts should reflect the physical keyboard. They should match the keyboard layout. I know what physical key to press to trigger a /. This is how Atom behaves.
{ "key": ".", "command": "^acceptSelectedSuggestion",
"when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey && editorLangId == 'typescript'" },
Suggests: For your current keyboard layout press v
Really? Someone thought that was a solution?
I went through and remapped all keybindings to DVORAK suggestions. Here's my keybindings.json if anyone else wants to do this and not go through every frickin' line.
But agree with @HookyQR – this is a really piss poor solution for folks with alternative keyboards. If you can detect what the shortcut should be, just swap it :/
[
{
"key": "cmd+/",
"command": "editor.action.outdentLines",
"when": "editorTextFocus"
},
{
"key": "cmd+.",
"command": "editor.action.quickFix",
"when": "editorTextFocus"
},
{
"key": "shift+cmd+/",
"command": "editor.fold",
"when": "editorFocus"
},
{
"key": "cmd+k cmd+[",
"command": "editor.foldRecursively",
"when": "editorFocus"
},
{
"key": "cmd+k cmd+]",
"command": "editor.unFoldRecursively",
"when": "editorFocus"
},
{
"key": "shift+cmd+]",
"command": "editor.unfold",
"when": "editorFocus"
},
{
"key": "cmd+[",
"command": "editor.action.commentLine",
"when": "editorTextFocus"
},
{
"key": "cmd+-",
"command": "editor.action.outdentLines",
"when": "editorTextFocus"
},
{
"key": "cmd+=",
"command": "editor.action.indentLines",
"when": "editorTextFocus"
},
{
"key": "ctrl+[",
"command": "workbench.action.navigateBack"
},
{
"key": "ctrl+shift+[",
"command": "workbench.action.navigateForward"
},
{
"key": "cmd+w",
"command": "workbench.action.openGlobalSettings"
},
{
"key": "cmd+]",
"command": "workbench.action.zoomIn"
},
{
"key": "cmd+[",
"command": "workbench.action.zoomOut"
},
{
"key": "v",
"command": "^acceptSelectedSuggestion",
"when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey && editorLangId == 'typescript'"
},
]
@chexee thanks for this! I find this still to be incredibly confusing. I can't have my dvorak-layout cmd + w (physical cmd + ,) to map to openGlobalSettings, while also having dvorak-layout cmd + , (physical cmd + w) map to close window. There seems to be no way I can make this happen, meaning I'll have to rebind one or the other.
For some reason, VSCode detects that cmd+, "maps to cmd+w on your layout" (which I don't really want, but can deal with), but if I make a mapping for cmd+w, it does _not_ detect that that should "map to cmd+, on your layout", so there seems to be no way to resolve this.
Update: for now, I've mapped shift+cmd+w to get to preferences.
I actually gave up on mapping. The above still didn't cover everything and the experience for dvorak is just taking too much time to make right. I probably won't switch until this is handled better.
Would using event.key be better? Does Monaco support any browsers that don't fully support it?
That might eliminate a fair amount of code in keyCodes.ts, and enable keybindings like BrowserBack.
Is there anything I can to do push for getting a real fix? vscode is effectively unusable w/ Dvorak and other non-physical layouts. Patreon?
This seems to work for me on a fresh Sierra + VS Code install. Could it be a conflict with pre-existing configuration in the settings folder?
Even the ⌘+, shortcut issue seems to be gone (it would open the settings, but first would close the current tab as if it was ⌘+w).
For those of you still having issues, you can drop the 'fix' by editing the app code as I've mentioned here: https://github.com/Microsoft/vscode/issues/15624#issuecomment-261412779
I've put in a PR (https://github.com/Microsoft/vscode/pull/15687) to remove the re-mapping altogether, since it is effectively useless, we'll see how that goes.
I have validated that we now (i.e. after PR #22894 aka #17521 -- in today's upcoming Insiders build) appear to behave correctly for this keyboard layout

editor.action.commentLineeditor.action.commentLine is bound by default to the key code binding cmd+// can be produced through one scan code: [BracketLeft]. i.e.
Cmd+[BracketLeft] i.e.
I have validated that pressing Cmd+[BracketLeft] does indeed toggle line comment.
This makes me believe the fix in PR #22894 aka #17521 resolves this issue.
I have just tried the latest version of VS Code and the latest Insiders build and this isn't behaving as expected with the Dvorak - QWERTY layout.
Mac's built in Dvorak - QWERTY layout allows typing in DVORAK, but reverts to QWERTY when holding command so you don't have to reach all the way across the keyboard to do common actions like copy and save.
VS Code is undoing all of Mac's work and returning the keyboard shortcuts back to Dvorak.
@Tsmith18256 I don't believe that's the default action on a Mac, I use DVORAK and actually get quite annoyed with any apps that would switch back to QWERTY with the modifier keys (I don't use any apps regularly that do that)
@jdavidbakr Not DVORAK, "Dvorak - QWERTY." It's another layout that's only available on Mac and one of my favourite parts about Mac over Windows/Linux.
It's not default action, it's a keyboard you can enable via MacOS.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Tyler Smith notifications@github.com
Sent: Tuesday, April 25, 2017 6:22:12 AM
To: Microsoft/vscode
Cc: Chelsea Otakan; Mention
Subject: Re: [Microsoft/vscode] Command-/ with Dvorak keyboard on Mac OS X no longer comments/uncomments (#1492)
@jdavidbakrhttps://github.com/jdavidbakr Not DVORAK, "Dvorak - QWERTY"
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/vscode/issues/1492#issuecomment-296899311, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AARcjASQfwyvA7eLwiaxF1GJlmBX4AU5ks5rzXT0gaJpZM4G4t5m.
@chexee Yeah exactly, and the issue is that I have it enabled and VS Code is ignoring it. On every program on my computer I press the QWERTY versions of Ctrl-C for copy, Ctrl-Z for undo, etc.
In VS Code, I have to press the Dvorak versions, even though I enabled Dvorak - QWERTY, which means reaching way across the keyboard for really common actions.
Yeah. Until VS Code can map to the native keyboard mappings, stuff like this will keep coming up.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Tyler Smith notifications@github.com
Sent: Tuesday, April 25, 2017 6:37:58 PM
To: Microsoft/vscode
Cc: Chelsea Otakan; Mention
Subject: Re: [Microsoft/vscode] Command-/ with Dvorak keyboard on Mac OS X no longer comments/uncomments (#1492)
@chexeehttps://github.com/chexee Yeah exactly, and the issue is that I have it enabled and VS Code is ignoring it. On every program on my computer I press the QWERTY versions of Ctrl-C for copy, Ctrl-Z for undo, etc.
In VS Code, I have to press the Dvorak versions, even though I enabled Dvorak - QWERTY, which means reaching way across the keyboard for really common actions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/vscode/issues/1492#issuecomment-297089239, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AARcjILDuKYW8ehkL8FYS7kJ5SSfUVk-ks5rziFmgaJpZM4G4t5m.
Yep, would have been easier if they just did the breaking change like I suggested originally. Broke a bunch of other stuff anyway. Oh well. ¯_(ツ)_/¯
There exists a workaround for the "Dvorak - QWERTY" keyboard layout explained in #23964. i.e. "keyboard.dispatch": "keyCode"
Most helpful comment
I went through and remapped all keybindings to DVORAK suggestions. Here's my
keybindings.jsonif anyone else wants to do this and not go through every frickin' line.But agree with @HookyQR – this is a really piss poor solution for folks with alternative keyboards. If you can detect what the shortcut should be, just swap it :/