microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.73k stars 28.44k forks source link

Keyboard shortcut key presses gets emitted to Webview #85879

Closed PEZ closed 1 year ago

PEZ commented 4 years ago

Issue Type: Bug

When using shortcuts, while having a webview open, the shortcut's key presses ”leaks” out and are sent to the webview.

Reproduce

This can be reproduced using the Jupyter extension:

  1. Configure Zoom in to be just a character, say z, using the regular Shortcuts UI
  2. Create a new Jupyter Notebook and focus an input prompt.
  3. Use that shortcut

Expected: VS Code zooms, and nothing else happens.

Actual: VS Code zooms, and z is typed at the Jupyter prompt.

VS Code version: Code 1.40.2 (f359dd69833dd8800b54d458f6d37ab7c78df520, 2019-11-25T14:52:45.129Z) OS version: Darwin x64 19.0.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|3, 3, 3| |Memory (System)|16.00GB (0.32GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (10) Extension|Author (truncated)|Version ---|---|--- calva|bet|2.0.63 emojisense|bie|0.5.3 clj-kondo|bor|0.0.11 better-toml|bun|0.3.2 gitlens|eam|10.2.0 restructuredtext|lex|116.0.0 python|ms-|2019.11.50794 vscode-yaml|red|0.6.1 code-spell-checker|str|1.7.20 JavaScriptSnippets|xab|1.7.2
PEZ commented 4 years ago

I am an extension author, and my extension also has a REPL Webview. Right now I have to avoid providing default keybindings with chords ending in a typeable character. This is bad, because a lot of the commands for my extension make total sense to use with chords ending in regular characters.

This is extra bad because I also have to instruct my users to do avoid chords like that, regardless if the shortcut is related to my extension or not.

infokiller commented 3 years ago

Edit: I commented on the wrong issue, see #137167 instead

bowernite commented 3 years ago

Same thing for when using preview for something like markdown. It's a pretty big productivity killer when the webview steals keyboard focus/events, and all of your keyboard shortcuts are disabled (until you use the mouse to click somewhere else).

infokiller commented 2 years ago

@PEZ I can no longer reproduce this issue in a Jupyter Notebook (possibly because I'm using the new experience). Do you have another example of a Webview that can reproduce this bug?

VSCodeTriageBot commented 1 year ago

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

PEZ commented 1 year ago

I quit using the Webview where I hit against this thing. It was a lot of work replacing it, but in the end it worked out well. So... I don't have this problem any longer.