title: vscode extension - How to log keystrokes
body: <p>I am doing user testing for a <code>vscode extension</code> (for some university project) and I need to get a log of the keys that are pressed in the text editor.</p>
  
  <p>I have tried with <code>onDidChangeTextDocument</code>, 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:</p>
  
  <pre><code>vscode.window.activeTextEditor.addEventListener(('keydown', event =&gt; {
    console.log(`KeyboardEvent: ${event.key || event.keyCode}`)
  }))
  </code></pre>
  
  <p>but it doesn't look like <code>activeTextEditor</code> allows to add such function.</p>
  
  <p>Does anyone know if vscode allows to listen for keystrokes?</p>