vscode icon indicating copy to clipboard operation
vscode copied to clipboard

vscode reads AltGr key as cursor-left move through X11 connections

Open snoetzel32 opened this issue 8 years ago • 23 comments

  • VSCode Version: 1.11.2 (Commit 6eaebe3b9c70406d67c97779468c324a7a95db0e)
  • OS Version: Ubuntu 16.04.2 / Windows 10

Steps to Reproduce:

  1. install/start X server on Windows system (Xming, MobaXterm or VcXsrv)
  2. start code on Linux box (make sure your SSH client has X11 forwarding enbled), use AltGr to compose "{" or similar, cursor jumps left. Interesting to note that both the "{" character and the cursor-left move are produced. This has started with VScode 1.11. Same with code-insiders. Don't get me started.
  3. Tested on 4 different computers.

snoetzel32 avatar Apr 14 '17 14:04 snoetzel32

Experienced the same (same config as OP except Win 7). You can see the cursor move left when clicking just AltGr. The problem stopped when I -- as the release notes for 1.11.1 suggests -- switched to "keyboard.dispatch": "keyCode".

brotulix avatar Apr 26 '17 08:04 brotulix

I had the same issue. Adding "keyboard.dispatch":"keyCode" fixed it. Thanks @brotulix

meuter avatar May 11 '17 07:05 meuter

After updating to 1.15.1 I had this problem. I didn't have it with prior versions since 1.12 I think. Setting the parameter as suggested by @brotulix fixed the problem.

chmike avatar Sep 02 '17 12:09 chmike

I had the same issue with version 1.16.1. The solution proposed works as expected!

serl avatar Oct 03 '17 12:10 serl

This solved this issue for me, Thanks :-)

eazrael avatar Mar 29 '18 19:03 eazrael

Adding "keyboard.dispatch":"keyCode" fixed the issue but creates an other one.
I can't use the ctrl+/ to comment a line of code anymore.

sey avatar May 25 '18 13:05 sey

I had the same problem for a week, struggling with setkbdmap and others. Thanks for the info.

As for the ctrl + / shortcut, i had to remap it to ctrl + shift + / (azerty kbd) even if it worked before when mapped to ctrl + /

FlorianIragne avatar Jun 18 '18 07:06 FlorianIragne

I had the same problem and changing it to keyCode fixed it for me.

inversus avatar Sep 19 '18 10:09 inversus

This also fixed the "/" key of the numpad acting like "page up" for me

yannickvidal avatar Dec 05 '18 13:12 yannickvidal

same problem and solution here. I believe this only started after upgrading to 1.30.2. Prior version 1.28 or so.

flurin-conradin avatar Feb 05 '19 17:02 flurin-conradin

This was driving me crazy, I thought it was the auto-completion of the braces, until I finally realized the cursor was moving as soon as I pressed AltGr. Thanks a bunch!

sam-sla avatar Feb 20 '19 15:02 sam-sla

https://github.com/Microsoft/vscode/wiki/Keybinding-Issues

serhatates avatar Mar 07 '19 10:03 serhatates

Thanks! Really useful.

miguelcanosantana avatar Nov 18 '19 09:11 miguelcanosantana

"keyboard.dispatch":"keyCode" fixed both "/" on NumPad and "Alt Gr" issues. (v 1.45.0)

rnovicky avatar May 13 '20 09:05 rnovicky

Had the same issue with vscode and Remote Desktop from Windows 10 to an Ubuntu Desktop VM running vscode. Thanks to this setting the really annoying cursor jumps to the left when entering brackets are gone now. You are awesome guys! :)

andreas5232 avatar Sep 10 '20 07:09 andreas5232

Had this problem on Remote Desktop to my Linux Mint machine in vscode 1.55.2. keyCode fixed it.

viell-dev avatar Apr 26 '21 09:04 viell-dev

Unfortunately, it does not work with vscode in WSLg. Neither code nor keycode fixes the issue. In a terminal opened in vscode, the issue is the same. However, in a standard WSL2 terminal, the issue does not occur.

Karreg avatar Oct 20 '21 09:10 Karreg

Thanks for this solution, I had this exact problem with vscode in a Kubuntu 20.04 virtual machine. The setting has to be applied for "User", and then it solves the AltGr = "left move" problem that was driving me crazy.

arnholm avatar Nov 23 '21 12:11 arnholm

Thanks from my side, too. I had never found this by myself. Just for the records: here's the link to MS's documentation: https://code.visualstudio.com/updates/v1_11#_improved-keyboard-layout-support

bkstein avatar Nov 03 '23 08:11 bkstein

Same issue when using Remmina to RDP from Ubuntu 20 to Ubuntu 22, Qwertz keyboard layout (and yes, also with all other extensions disabled). Confirm that "keyboard.dispatch": "keyCode" works but breaks Ctrl + / - and I fear further keyboard shortcuts could be affected as well ...

Further, I use settings sync but would like not to synchronize this particular setting. There seems not to be a way to define certain settings locally on a single device - or even better, only when a remote connection to the DE is detected? Would be really great if support for this could be improved!

LinqLover avatar Apr 14 '24 12:04 LinqLover

I don't beleave it, this issue is 7 years old and yet no solution? It is absolute productivity stopper: after a while of blind typing you find a completely messed up source file and have to correct it keystroke by keystroke.

hatelamers avatar Jun 18 '24 15:06 hatelamers

thanks a lot, because i didn't found the wiki link by myself yet. on a remote debian 12 + cinamon + xrdp connection with remmina, french keyboard was working fine with all kb layouts i tried, excepting in vscode 1.90.2. during rdp connection. No problem when using local console.

efedus avatar Jun 27 '24 08:06 efedus

Setting keyboard.dispatch to keyCode in the settings solved the problem for me.

Leon-Sander avatar Oct 19 '24 12:10 Leon-Sander

April 2025, still the issue remains :-(

cminnoy avatar Apr 02 '25 11:04 cminnoy

Adding "keyboard.dispatch": "keyCode" to Preferences: Open User Settings (JSON) works for me, thanks!

v-mdev avatar Jun 18 '25 11:06 v-mdev