kasecato / vscode-intellij-idea-keybindings

Port of IntelliJ IDEA key bindings for VS Code.
https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings
MIT License
813 stars 135 forks source link

v1.5.10 broke ctrl+z with Dvorak keyboard layout #307

Closed nyurik closed 3 months ago

nyurik commented 11 months ago

This only happened in v1.5.10. Switching back to v1.5.9 fixes this issue.

To reproduce (on Linux), install this plugin in VSCode and configure your system to use Dvorak keyboard layout. In a typescript file in VSCode, make several different changes, and use "undo" shortcut -- Ctrl+/ multiple times (the / key is mapped to z in Dvorak).

Expected: multiple undos Actual: current line gets commented and un-commented with the //, as if I was using QWERTY

Versions

Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:18:39.991Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 5.15.0-79-generic

---

Name: IntelliJ IDEA Keybindings
Id: k--kato.intellij-idea-keybindings
Description: Port of IntelliJ IDEA Keybindings, including for WebStorm, PyCharm, PHP Storm, etc.
Version: 1.5.10
Publisher: Keisuke Kato
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings

Possibly related issues

nyurik commented 11 months ago

I am not sure this issue belongs to the vscode repo, but I think authors of https://github.com/microsoft/vscode/pull/173456 half a year ago might have some insight into how an extension could disrupt their fix. CC: @hamzahamidi and @alexdima

kasecato commented 3 months ago

Looks like this should use a virtual key code

As-Is

            {
                "key": "ctrl+[Slash]",
                "mac": "cmd+[Slash]",
                "command": "editor.action.commentLine",
                "when": "editorTextFocus && !editorReadonly",
                "intellij": "Comment/uncomment with line comment"
            },

To-Be

            {
                "key": "ctrl+oem_2",
                "mac": "cmd+[Slash]",
                "command": "editor.action.commentLine",
                "when": "editorTextFocus && !editorReadonly",
                "intellij": "Comment/uncomment with line comment"
            },
nyurik commented 3 months ago

Thanks for looking into it! Does the "mac" section need to be updated too? (I don't use Mac, so no idea, but others might hit this bug there as well)

kasecato commented 3 months ago

That's true It would be better to fire key codes according to the keyboard layout in all operating systems Let me revert #305 since they should change the keyboard layout in thier OS

            {
                "key": "ctrl+/",
                "mac": "cmd+/",
                "command": "editor.action.commentLine",
                "when": "editorTextFocus && !editorReadonly",
                "intellij": "Comment/uncomment with line comment"
            },
kasecato commented 3 months ago

just released v1.7.0 that supports for Dvorak layouts If there're issues with the layout, this extension guides the user to use a hardware keyboard that matches the key layout of their OS