Inside a findWidget (or any other input widget) the cursor can only be moved with the cursor keys. I want to move the widget's cursor with a shortcut key that I define.
I looked it up at Developer: Toggle Keyboard Shortcuts Troubleshooting.
When I set CTRL+S as below,
If you put the cursor on findWidget and press CTRL+S it will be matched cursorLeft, when: editorFocus && findInputFocussed && findWidgetVisible and will execute cursorLeft, which will move the cursor in the editor screen.
{
"key": "CTRL+S",
"command": "cursorLeft",
"when": "editorFocus && findWidgetVisible && findInputFocussed",
},
[2022-09-15 02:07:09.425] [renderer1] [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control
[2022-09-15 02:07:09.444] [renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 ('Ctrl')
[2022-09-15 02:07:09.444] [renderer1] [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
[2022-09-15 02:07:09.531] [renderer1] [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: KeyS, keyCode: 83, key: s
[2022-09-15 02:07:09.532] [renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: KeyS, keyCode: 49 ('S')
[2022-09-15 02:07:09.532] [renderer1] [info] [KeybindingService]: | Resolving ctrl+S
[2022-09-15 02:07:09.532] [renderer1] [info] [KeybindingService]: \ From 2 keybinding entries, matched cursorLeft, when: editorFocus && findInputFocussed && findWidgetVisible, source: user.
[2022-09-15 02:07:09.532] [renderer1] [info] [KeybindingService]: + Invoking command cursorLeft.
[2022-09-15 02:07:09.744] [renderer1] [info] [KeybindingService]: + Ignoring single modifier ctrl due to it being pressed together with other keys.
LeftArrow doesn't match the when condition, so it doesn't Invoking command, but it does move the cursor in the findWidget.
[2022-09-15 02:17:35.543] [renderer1] [info] [KeybindingService]: / Received keydown event - modifiers: [], code: ArrowLeft, keyCode: 37, key: ArrowLeft
[2022-09-15 02:17:35.563] [renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: ArrowLeft, keyCode: 15 ('LeftArrow')
[2022-09-15 02:17:35.563] [renderer1] [info] [KeybindingService]: | Resolving LeftArrow
[2022-09-15 02:17:35.563] [renderer1] [info] [KeybindingService]: \ From 10 keybinding entries, no when clauses matched the context.
Is it possible to make arbitrary shortcut keys work like LeftArrow?
I'd like to be able to move the cursor in the findWidget and use CTRL+H to delete characters.