Vscode: AltGr+ is no longer Ctrl+Alt+ starting with 1.31

Created on 6 Feb 2019  路  7Comments  路  Source: microsoft/vscode

Issue Type: Bug

vscode reset my keyboard shortcuts after 1.31 upgrade

VS Code version: Code 1.31.0 (7c66f58312b48ed8ca4e387ebd9ffe9605332caa, 2019-02-05T22:35:56.624Z)
OS version: Windows_NT x64 10.0.17763


System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i3-2328M CPU @ 2.20GHz (4 x 2195)|
|GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_off
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled|
|Memory (System)|3.89GB (0.54GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|

Extensions (21)

Extension|Author (truncated)|Version
---|---|---
Bookmarks|ale|10.2.2
vscode-database|baj|1.5.3
spellright|ban|3.0.22
vscode-icontheme-nomo-dark|be5|1.3.6
gitlens|eam|9.5.0
php-debug|fel|1.12.6
php-intellisense|fel|2.3.10
vscode-mysql|for|0.3.0
beautify|Hoo|1.4.8
vscode-icon-theme|jtl|1.6.5
php-symbols|lin|2.1.0
code-beautifier|mic|2.1.0
vscode-language-pack-fr|MS-|1.31.4
material-icon-theme|PKi|3.6.2
live-sass|rit|3.0.0
LiveServer|rit|5.3.1
sass-indented|rob|1.5.1
code-settings-sync|Sha|3.2.4
vscode-todo-highlight|way|1.0.4
vinala-ext|You|0.2.6
file-size|zh9|0.1.3

(1 theme extensions excluded)


electron-3-update

Most helpful comment

The change comes from a bug fix in Chromium (1, 2). Previously on Windows with many European language layouts, when users press AltGr, Chromium will emit a keyboard event AltGraph with modifiers alt and control :

KeyboardEvent {
    altKey : true
        controlKey: true
        code : "AltRight"
        key : "AltGraph"
}

Chromium changed this behavior to align Windows with other OS by reseting the altKey and controlKey modifiers.

KeyboardEvent {
    altKey : false
        controlKey: false
        code : "AltRight"
        key : "AltGraph"
}

How does this affect VS Code keybindings

if you only look at modifiers, it looks like users press Ctrl + Alt so every keybinding like Ctrl+Alt+xyz can be triggered by AltGr+xzy on Windows with these keyboard layouts. It's a breaking change as treating AltGr as Ctrl+Alt is unintentional. If we want to bring back the old behavior, then we need to differentiate AltLeft and AltRight. @alexandrudima knows more about this one.

All 7 comments

It happens to me too

i guess the shortcuts starting with alt gr doesn't work

Yes I have just tried it, and I can't use shortcuts starting with alt gr but with alt everything is perfect

I can confirm alt gr shortcuts don't work anymore

The change comes from a bug fix in Chromium (1, 2). Previously on Windows with many European language layouts, when users press AltGr, Chromium will emit a keyboard event AltGraph with modifiers alt and control :

KeyboardEvent {
    altKey : true
        controlKey: true
        code : "AltRight"
        key : "AltGraph"
}

Chromium changed this behavior to align Windows with other OS by reseting the altKey and controlKey modifiers.

KeyboardEvent {
    altKey : false
        controlKey: false
        code : "AltRight"
        key : "AltGraph"
}

How does this affect VS Code keybindings

if you only look at modifiers, it looks like users press Ctrl + Alt so every keybinding like Ctrl+Alt+xyz can be triggered by AltGr+xzy on Windows with these keyboard layouts. It's a breaking change as treating AltGr as Ctrl+Alt is unintentional. If we want to bring back the old behavior, then we need to differentiate AltLeft and AltRight. @alexandrudima knows more about this one.

I can confirm this too.

It it not just that AltGr is not recognised as Ctrl + Alt it is recognised as a weird Alt. When one tries to make new shortcuts and presses AltGr VSCode inputs as Alt + but all subsequent keypresses reset this to the new key press, For example AltGr + e yields e.

We don't plan to do anything here. AltGr+ is no longer Ctrl+Alt+ and we will just live with this.

Was this page helpful?
0 / 5 - 0 ratings