microsoft / vscode

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

The waiting second key is intercepted by the input method #151496

Closed yueduz closed 1 year ago

yueduz commented 2 years ago

Issue Type: Bug

When the input method is activated, during the process of using the combination shortcut Ctrl-K k: (Ctrl-K) has been pressed, waiting for the second key, the second key is blocked by the input method. So the input method should be automatically disabled while waiting for the second keypress.

VS Code version: Code 1.67.2 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5, 2022-05-17T18:23:40.286Z) OS version: Linux x64 5.18.1-arch1-1 Restricted Mode: Yes

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 1700 Eight-Core Processor (16 x 2252)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|1, 0, 0| |Memory (System)|15.64GB (9.74GB free)| |Process Argv|--unity-launch --crash-reporter-id fbdf6ce9-df85-417f-91bc-592561b058e1| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|gnome-xorg| |XDG_CURRENT_DESKTOP|GNOME| |XDG_SESSION_DESKTOP|gnome-xorg| |XDG_SESSION_TYPE|x11|
Extensions (16) Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|13.3.0 arm|dan|1.7.4 vscode-pull-request-github|Git|0.42.0 vue-snippets|hol|1.0.4 vscode-language-pack-zh-hans|MS-|1.67.3 cpptools-extension-pack|ms-|1.2.0 vsliveshare|ms-|1.0.5615 vsliveshare-pack|ms-|0.4.0 material-icon-theme|PKi|4.18.0 vscode-yaml|red|1.7.0 vim|vsc|1.22.2 volar|Vue|0.37.3 vscode-typescript-vue-plugin|Vue|0.37.3 JavaScriptSnippets|xab|1.8.0 material-theme|zhu|3.13.29 linkerscript|Zix|1.0.2 (2 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyl392:30443607 pythontb:30283811 pythonvspyt551:30345470 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 vscscmwlcmt:30465135 cppdebug:30492333 vscaac:30438847 vsclangdf:30486550 ```
alexdima commented 2 years ago

@yueduz So the command you're trying to execute is ctrl+k k while having IME active? Is this a problem specific to second parts which are used without modifiers? Would using ctrl+k ctrl+k as a keybinding work for you?

yueduz commented 2 years ago

@yueduz So the command you're trying to execute is ctrl+k k while having IME active? Is this a problem specific to second parts which are used without modifiers? Would using ctrl+k ctrl+k as a keybinding work for you?

Yes, the command "ctrl+k k" is when the IME is active. Using "ctrl+k ctrl+k" as a key binding works for me, but I still need to use "ctrl+k k" binding.

alexdima commented 2 years ago

I still need to use "ctrl+k k" binding.

I think the code might be entering this statement and stopping propagation of the k keydown event. Removing that might break IME, that if statement was initially added for https://github.com/microsoft/vscode/issues/24861

yueduz commented 2 years ago

Is there a way to make vscode lose the text focus when "ctrl+k" is pressed, so that vscode can continue to listen for subsequent key presses without affecting the input method. After processing the keystroke, let vscode get the text focus.

Or there are vim plugins that can automatically switch IMEs when the mode is switched. Is it possible to automatically switch the IME when pressing "ctrl+k"?

guttyon commented 2 years ago

See also #72176, which has already been closed. This problem also occurs in windows.