VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
14k stars 1.32k forks source link

Escape key pressed once but input twice #9307

Closed bogardon closed 1 month ago

bogardon commented 1 month ago

I'm using linux and have a keyboard mapping where I make capslock act as another escape.

When I'm editing a file and I quickly hit, starting in normal mode, "i" -> "escape" -> "i", I initially return to input mode as expected, but a second later another escape gets received as input and I'm suddenly out of insert mode.

Here is the output of Developer: Toggle Keyboard Shortcuts Troubleshooting:

2024-10-14 22:18:34.211 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-10-14 22:18:34.224 [info] [KeybindingService]: | Resolving I
2024-10-14 22:18:34.225 [info] [KeybindingService]: \ No keybinding entries.
2024-10-14 22:18:34.225 [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: KeyI, keyCode: 73, key: i
2024-10-14 22:18:34.225 [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: KeyI, keyCode: 39 ('I')
2024-10-14 22:18:34.225 [info] [KeybindingService]: | Resolving I
2024-10-14 22:18:34.225 [info] [KeybindingService]: \ No keybinding entries.
2024-10-14 22:18:34.437 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-10-14 22:18:34.437 [info] [KeybindingService]: | Resolving Escape
2024-10-14 22:18:34.437 [info] [KeybindingService]: \ From 73 keybinding entries, matched extension.vim_escape, when: editorTextFocus && vim.active && !inDebugRepl, source: user extension vscodevim.vim.
2024-10-14 22:18:34.437 [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: CapsLock, keyCode: 27, key: Escape
2024-10-14 22:18:34.437 [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: CapsLock, keyCode: 9 ('Escape')
2024-10-14 22:18:34.438 [info] [KeybindingService]: | Resolving Escape
2024-10-14 22:18:34.438 [info] [KeybindingService]: \ From 73 keybinding entries, matched extension.vim_escape, when: editorTextFocus && vim.active && !inDebugRepl, source: user extension vscodevim.vim.
2024-10-14 22:18:34.438 [info] [KeybindingService]: + Invoking command extension.vim_escape.
2024-10-14 22:18:34.649 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-10-14 22:18:34.649 [info] [KeybindingService]: | Resolving I
2024-10-14 22:18:34.649 [info] [KeybindingService]: \ No keybinding entries.
2024-10-14 22:18:34.649 [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: KeyI, keyCode: 73, key: i
2024-10-14 22:18:34.649 [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: KeyI, keyCode: 39 ('I')
2024-10-14 22:18:34.649 [info] [KeybindingService]: | Resolving I
2024-10-14 22:18:34.649 [info] [KeybindingService]: \ No keybinding entries.
2024-10-14 22:18:36.438 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-10-14 22:18:36.438 [info] [KeybindingService]: | Resolving Escape
2024-10-14 22:18:36.439 [info] [KeybindingService]: \ From 73 keybinding entries, matched extension.vim_escape, when: editorTextFocus && vim.active && !inDebugRepl, source: user extension vscodevim.vim.
2024-10-14 22:18:36.439 [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: CapsLock, keyCode: 27, key: Escape
2024-10-14 22:18:36.439 [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: CapsLock, keyCode: 9 ('Escape')
2024-10-14 22:18:36.439 [info] [KeybindingService]: | Resolving Escape
2024-10-14 22:18:36.439 [info] [KeybindingService]: \ From 73 keybinding entries, matched extension.vim_escape, when: editorTextFocus && vim.active && !inDebugRepl, source: user extension vscodevim.vim.
2024-10-14 22:18:36.439 [info] [KeybindingService]: + Invoking command extension.vim_escape.
bogardon commented 1 month ago

Well I found out that it's my OS that is acting weirdly. It does seem to double input outside of vscode vim too.