Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releasing Alt sometimes inserts characters #141175

Closed
dmchurch opened this issue Jan 21, 2022 · 3 comments
Closed

Releasing Alt sometimes inserts characters #141175

dmchurch opened this issue Jan 21, 2022 · 3 comments
Assignees
Labels
info-needed Issue requires more information from poster windows VS Code on Windows issues

Comments

@dmchurch
Copy link

Issue Type: Bug

I don't have a reliable STR, unfortunately, but I've been having an intermittent issue for quite a while which manifests as follows:

  1. Hold the Alt key. (Left Alt, if you're curious.)
  2. Press Up/Down to move the current line/selection up or down
  3. Release the Alt key.

The editor then acts as if I'd typed a character; sometimes R, or X, or sometimes an undisplayable Unicode character, among others. This means it gets inserted at the cursor point, or if I had a selection, it replaces the selection.

Of course, now that I'm trying to reproduce it, it doesn't happen, so I don't expect anyone else can track it down for me; for all I know it may be some weird interaction with OS-level software. What I want to know is, does VSC have some sort of internal logging where I can see what actions it has performed recently, and why? If I could narrow down what it thought it was doing, I could maybe figure out why it was doing it.

VS Code version: Code 1.63.2 (899d46d, 2021-12-15T09:40:02.816Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2208)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.92GB (18.28GB free)
Process Argv --enable-proposed-api redhat.java --crash-reporter-id ac355797-2567-4ffb-9b4c-ea2f04db70d0
Screen Reader no
VM 0%
Extensions (23)
Extension Author (truncated) Version
java-decompiler Ben 0.0.3
save-editors-layout ctf 0.2.2
remove-multi-cursors dmc 0.0.1
gitlens eam 11.7.0
remotehub Git 0.22.0
latex-workshop Jam 8.23.0
local-code loc 0.0.4
remote-containers ms- 0.209.6
remote-ssh ms- 0.70.0
remote-ssh-edit ms- 0.70.0
remote-wsl ms- 0.63.13
vscode-remote-extensionpack ms- 0.21.0
hexeditor ms- 1.9.3
gradle-language nac 0.2.3
java red 1.2.0
functional-cursors spo 0.0.8
vscodeintellicode Vis 1.2.15
vscode-gradle vsc 3.9.0
vscode-java-debug vsc 0.37.0
vscode-java-dependency vsc 0.18.9
vscode-java-pack vsc 0.20.0
vscode-java-test vsc 0.33.1
vscode-maven vsc 0.34.2
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392cf:30425750
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dsc:30424895
pythonvs932:30410667
vscop804:30404766
vscop341:30404997
vsrem710cf:30416617
vsbas813:30426126
vsic-wlc-tsjs:30426436

@alexdima alexdima added the windows VS Code on Windows issues label Jan 25, 2022
@alexdima
Copy link
Member

alexdima commented Jan 25, 2022

@dmchurch What kind of keyboard are you on? Are perhaps the arrow keys sometimes acting as a numpad? The only special kind of input on Windows that I'm aware of that sounds similar would be the Alt+Numpad Keys special character insertion. Here's a site that explains this.

ALT+082 would create an R (maybe up arrow (8), down arrow (2) )
Also ALT+088 would create an X (maybe up arrow (8), up arrow (8) )

image

@alexdima alexdima added the info-needed Issue requires more information from poster label Jan 25, 2022
@dmchurch
Copy link
Author

@alexdima !!!!!!!! omg you're absolutely right, that's totally what it is. Wow, I haven't thought about Alt keycodes in like two decades! And I absolutely do use the numpad on my laptop keyboard for navigation, since it doesn't have independent home/end/etc keys. (I end up switching numlock a lot when I'm on this laptop.)

Y'know, I'd thought that Windows only did Alt+numpad insertions when numlock was on, but clearly that's not the case. At least I have a workaround, though - using the dedicated arrow keys for alt+up/down!

It does bring up a question, though: is there any way to tell Windows not to process that key combination as part of an alt code if VSCode is handling it as an event?

@alexdima
Copy link
Member

I'm glad that was the root cause. We can continue tracking in #22364 , but it doesn't seem likely that things will improve, I remember reporting this upstream, but nothing happening.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

2 participants