Vscode: Can't type quotes with US INTL on Windows

Created on 5 Nov 2019  路  9Comments  路  Source: microsoft/vscode

Moved from https://github.com/MicrosoftDocs/vsonline/issues/68

From @sadasant


I'm using VSCode online, the web version, and I'm unable to type single quotes, double quotes and symbols like `.

I am using US International as my keyboard layout locally. The online editor does let me write accented letters, like: 谩茅铆贸煤, etc.

So far I've been managing by copying and pasting these symbols. It hasn't stopped me from using the site, but it is kind of weird.

I'm using Chrome version 78.0.3904.70 (Official Build) (64-bit) on the latest available Window version.

bug keyboard-layout web windows

All 9 comments

This must be a recent regression since the editor at https://microsoft.github.io/monaco-editor/ allows quotes to be typed.

This must be a recent regression since the editor at https://microsoft.github.io/monaco-editor/ allows quotes to be typed.

I can confirm this too! 馃尀

I cannot reproduce when loading only the standalone editor, but I can reproduce when loading the entire workbench.

Also, interestingly, no native <input> accepts an accent like ' + space. The results is always a space in the <input>...

Interestingly, this has to do with the keybinding service where if I comment out the following section I can type again quotes:

https://github.com/microsoft/vscode/blob/308ff31f9585211a12e95afbab6829c088b2bc72/src/vs/workbench/services/keybinding/browser/keybindingService.ts#L220-L226

Ok, further progress... commenting out this specific line will allow typing quotes to work again -- https://github.com/microsoft/vscode/blob/308ff31f9585211a12e95afbab6829c088b2bc72/src/vs/workbench/services/keybinding/browser/keybindingService.ts#L415

OK, @rebornix, AFAICT the following is happening:

  • when first typing Quote
  • the mapping is invalidated because Quote does not produce ', because it is a dead key in this context
  • we then call navigator.keyboard.getLayoutMap()
  • I can only assume Chromium implements this in a similar way we have implemented it in node-native-keymap, which is to call MapVirtualKeyW. As part of doing that, you must clear the current keyboard state...

TL;DR -- two issues:

  • the US layout is permantently invalidated at each keystroke which makes it always reload itself... we should protect against such behavior...
  • calling navigator.keyboard.getLayoutMap() while composition is taking place ruins the keyboard state

@alexandrudima thanks for the detailed analysis. That's what's happening indeed.

Just to report something else: This also happens with some symbols, like ` and ^. I'm guessing this is related to accentuation, but 谩茅铆贸煤 work, for example.

Verified that now VS Code Web handles ' or ` the same as native app.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trstringer picture trstringer  路  3Comments

biij5698 picture biij5698  路  3Comments

borekb picture borekb  路  3Comments

chrisdias picture chrisdias  路  3Comments

mrkiley picture mrkiley  路  3Comments