microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.07k stars 28.81k forks source link

"add cursor below " not working on linux #162197

Closed pluveto closed 2 years ago

pluveto commented 2 years ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. set "Control+Alt+DownArrow" as short cut
    {
    "key": "ctrl+alt+down",
    "command": "editor.action.insertCursorBelow",
    "when": "editorTextFocus"
    }
  2. press "ctrl+alt+down"

expect add cursor below. but not working, ctrl+alt is activating menu bar

pluveto commented 2 years ago

image

See this after press ctrl+alt , lose focus

alexdima commented 2 years ago

Let's first try to find out what command executes on your machine, with your settings and your keybindings when pressing ctrl+alt+down. Could you please try the following:

If you are having trouble understanding the output, please feel free to paste here and I can try to help.

pluveto commented 2 years ago

I press ctrl, alt, t one after another, and release them all at once. log output:

[2022-09-30 00:04:22.724] [renderer10] [info] [KeybindingService]: / Received  keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control
[2022-09-30 00:04:22.758] [renderer10] [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 ('Ctrl')
[2022-09-30 00:04:22.758] [renderer10] [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
[2022-09-30 00:04:24.535] [renderer10] [info] [KeybindingService]: / Received  keydown event - modifiers: [ctrl,alt], code: AltLeft, keyCode: 18, key: Alt
[2022-09-30 00:04:24.535] [renderer10] [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl,alt], code: AltLeft, keyCode: 6 ('Alt')
[2022-09-30 00:04:24.535] [renderer10] [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.

seems down key not fired

pluveto commented 2 years ago

This is my binding: image Same issue when Developer: Reload With Extensions Disabled

alexdima commented 2 years ago

@pluveto Thank you for the extra information. From your log, it looks like VS Code is not receiving the keypress from OS. There is nothing we can do on our side if the OS doesn't dispatch the keypress. Are you able to use ctrl+alt+down in other applications on this machine?

pluveto commented 2 years ago
██████████████████  ████████   pluveto@pcportable 
██████████████████  ████████   ------------------ 
██████████████████  ████████   OS: Manjaro Linux x86_64 
██████████████████  ████████   Host: B450M DS3H 
████████            ████████   Kernel: 5.15.65-1-MANJARO 
████████  ████████  ████████   Uptime: 2 days, 3 hours, 11 mins 
████████  ████████  ████████   Packages: 1204 (pacman) 
████████  ████████  ████████   Shell: zsh 5.9 
████████  ████████  ████████   Resolution: 2560x1080 
████████  ████████  ████████   DE: GNOME 42.4 
████████  ████████  ████████   WM: Mutter 
████████  ████████  ████████   WM Theme: Flat-Remix-Violet-Dark-fullPanel 
████████  ████████  ████████
████████  ████████  ████████   Theme: Adw-dark [GTK2/3] 
                               Icons: Papirus-Dark [GTK2/3] 
                               Terminal: yakuake 
                               CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz 
                               GPU: NVIDIA GeForce RTX 3060 Ti Lite Hash Rate 
                               Memory: 9141MiB / 40036MiB 

I found ctrl+alt+n is not working in vscode, but works in https://vscode.dev/

final solution is

 gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['']"
 gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['']"
 gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "['']"
 gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "['']"