pokey / command-server

Secure VSCode communication channel designed for voice coding
MIT License
16 stars 9 forks source link

Fix Ubuntu f17 issue #9

Closed pokey closed 2 years ago

pokey commented 3 years ago
mzizzi commented 2 years ago

I think this is the result of a bug in the way vscode handles keystrokes. Check this out for debugging keystrokes/keybindings in vscode: https://code.visualstudio.com/docs/getstarted/keybindings#_troubleshooting-keybindings

The logs from below show that vscode sees the correct key events for ctrl+shift+f17:

Received  keydown event - modifiers: [shift], code: ShiftLeft, keyCode: 16, key: Shift
Converted keydown event - modifiers: [shift], code: ShiftLeft, keyCode: 4 ('Shift')
Keyboard event cannot be dispatched in keydown phase.
Received  keydown event - modifiers: [ctrl,shift], code: ControlLeft, keyCode: 17, key: Control
Converted keydown event - modifiers: [ctrl,shift], code: ControlLeft, keyCode: 5 ('Ctrl')
Keyboard event cannot be dispatched in keydown phase.
Received  keydown event - modifiers: [ctrl,shift], code: , keyCode: 128, key: F17
Converted keydown event - modifiers: [ctrl,shift], code: , keyCode: 75 ('F17')
Keyboard event cannot be dispatched in keydown phase.
Ignoring single modifier ctrl due to it being pressed together with other keys.

I see this for combos that work as expected:

Received  keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control
Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 ('Ctrl')
Keyboard event cannot be dispatched in keydown phase.
Received  keydown event - modifiers: [ctrl,shift], code: ShiftLeft, keyCode: 16, key: Shift
Converted keydown event - modifiers: [ctrl,shift], code: ShiftLeft, keyCode: 4 ('Shift')
Keyboard event cannot be dispatched in keydown phase.
Received  keydown event - modifiers: [ctrl,shift], code: F12, keyCode: 123, key: F12
Converted keydown event - modifiers: [ctrl,shift], code: F12, keyCode: 70 ('F12')
Resolving ctrl+shift+[F12]
From 1 keybinding entries, no when clauses matched the context.
Ignoring single modifier ctrl due to it being pressed together with other keys.

The only difference here is that we never get to Resolving ctrl+shift+[F12] in the F17 case. I'll look into this more as time permits.

pokey commented 2 years ago

Marking this one as closed because https://github.com/knausj85/knausj_talon/pull/650 seems to solve the problem wrt command server communications. But I would still argue for filing an issue with VSCode so they're aware of the problem they have with higher f-keys