I am doing user testing for a vscode extension
(for some university project) and I need to get a log of the keys that are pressed in the text editor.
I have tried with onDidChangeTextDocument
, but that doesn't capture keystrokes that don't modify the document (for instance, Ctrl or Alt). I have also tried to add an event listener to the active text editor like so:
vscode.window.activeTextEditor.addEventListener(('keydown', event => {
console.log(`KeyboardEvent: ${event.key || event.keyCode}`)
}))
but it doesn't look like activeTextEditor
allows to add such function.
Does anyone know if vscode allows to listen for keystrokes?