Open samdenty opened 1 year ago
Hmm... this works for me (ctrl + `), but I have a different issue. The keybindings from my window tiling app stopped working entirely. Perhaps related?
I think that's because vscode intercepts all keyboard shortcuts, COMMAND+SHIFT+B to toggle bookmarks bar also doesn't work
Just to add, I noticed this change after upgrading to the latest release.
In case this helps https://github.com/microsoft/vscode/wiki/Keybinding-Issues#summary
@roblourens is there a reason why it's broken in VSCode Web, but not on desktop? Setting keyboard.dispatch
to keyCode
fixes web, but it works with code
on desktop
is there a reason why it's broken in VSCode Web
Yes, on the desktop we have a native node module which we use to detect the key mappings. On the web, we need to rely on web APIs, which are incomplete.
This is happening to me on desktop FWIW.
On Sun, Oct 23, 2022, 12:47 PM Alexandru Dima @.***> wrote:
is there a reason why it's broken in VSCode Web
Yes, on the desktop we have a native node module which we use to detect the key mappings. On the web, we need to rely on web APIs, which are incomplete.
— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/163432#issuecomment-1288152431, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACUPVGTJXZSPVBEQWSLY6TWEVT2NANCNFSM6AAAAAARDK5H5U . You are receiving this because you commented.Message ID: @.***>
= Keybindings broken in VSCode web =
Similar also happening on Android: |*| 【F1】 ("Command Palette") outright not responding. |*| 【Ctrl】 + 【A】 ("Select All") has no effect [1] while 【Ctrl】 + 【C】/【V】 ("Copy" / "Paste") would work. |*| 【Tab】 could not be trapped. (causes keyboard navigation) |*| And many more. [1] Not happening in Chromium.
Setting `"keyboard.dispatch": "keyCode"` fixes the problem.
----
The portable way that should work from ancient IE to any modern mainstream browser is: (JavaScript) [[
if (
e.ctrlKey === true &&
(
e.keyCode === 65 ||
e.which === 65 ) ) {
// E.g. handling 【Ctrl】 + 【A】.
};
]]
@fny @MasterInQuestion Keybindings are OS, browser and keyboard layout dependent, which means you are running into problems which are distinct from the problem reported by the OP. Please open separate issues if you still have keybindings problems.
@samdenty What browser are you using?
Chrome on MacOS with British layout
@samdenty Thanks for your prompt reply. I believe this is caused by this piece of code in Chromium: https://source.chromium.org/chromium/chromium/src/+/main:ui/events/keycodes/keyboard_code_conversion_mac.mm;l=809-820?q=LMGetKbdType%20package:%5Echromium$&ss=chromium where they swap Backslash and IntlBackslash on macOS on ISO keyboards. For the VS Code build, we maintain a patch where we delete that code. We hit this before with https://github.com/microsoft/vscode/issues/24153
Does this reproduce in Firefox?
Edit: Found a newer bug on Chromium's side: https://bugs.chromium.org/p/chromium/issues/detail?id=1296783 fyi @deepak1556
It works for me in safari but it's broken for me in Firefox & Chrome with keyboard.dispatch: code
. Setting it to keycode fixes it, but makes both keys input the '`' character instead of IntlBackslash
Issue for Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1755096
Found a newer bug on Chromium's side: https://bugs.chromium.org/p/chromium/issues/detail?id=1296783
Awesome, this should help us remove the patch.
Yep, I can confirm it's broken in both Firefox/Chrome with doing:
window.onkeydown = (e) => console.log("code:", e.code, "key:", e.key);
[ Quote alexdima @ CE 2022-12-06 21:27:18 UTC: https://github.com/microsoft/vscode/issues/163432#issuecomment-1340028915 Keybindings are OS, browser and keyboard layout dependent, which means you are running into problems which are distinct from the problem reported by the OP. ] <^> Fundamentally caused by identical cause. (key binding in default configuration in general broken across browsers)
It's serious. (though proclaimed non-standard deprecated) Testable with example: https://github.com/MasterInQuestion/Markup/blob/main/picdif.htm
Still broken on Chrome almost a year later.
The keybindings are broken on MacOS for "`" & "§". You can see this by going to https://vscode.dev / https://github.dev on MacOS, opening the keyboard shortcut picker, clicking on a shortcut to edit & pressing both them keys.
Alternatively you can reproduce by pressing "CTRL+`", to open the terminal which doesn't work
ScanCode 106 (106 in enum) is detected as
IntlBackslash
(§) when it should be "`" https://github.com/microsoft/vscode/blob/5e2f5e57cb2d3a222d43de51541b0eda207914e8/src/vs/base/common/keyCodes.ts#L334.This is with the British layout: