title: Assign key to default button option when shown information message in vscode extension?
body: <p>I am creating an extension in VSCode that will close all open text documents when you click the option &quot;Yes&quot; in the <code>vscode.window.showInformationMessage(&quot;Want to close?&quot;, &quot;Yes&quot;, &quot;No)</code>.</p>
  <p>Pressing the &quot;Yes&quot; button will work fine but I want the &quot;Enter&quot; key on the keyboard to do the same? How can I listen for keystrokes when I register a command? Is it possible?</p>
  <p>Here is my code right now:</p>
  <pre><code>  context.subscriptions.push(
      vscode.commands.registerCommand(
        &quot;close-tabs&quot;,
        async (inputValue?: string) =&gt; {
          const { activeTextEditor } = vscode.window;
  
          if (!activeTextEditor) {
            vscode.window.showInformationMessage(&quot;No active text editor&quot;);
            return;
          }
  
          const answer = await vscode.window.showInformationMessage(&quot;Want to close tabs?&quot;, &quot;Yes&quot;, &quot;No&quot;);
  
          if (answer === &quot;Yes&quot;) {
            vscode.commands.executeCommand(&quot;openEditors.closeAll&quot;);
          }
          // ON_ENTER: I was thinking an if case here that checks if enter has been pressed and also executes the command above? 
        }
      )
    );
  </code></pre>
  <p>To reiterate. How can I choose the &quot;Yes&quot; option when pressing the &quot;Enter&quot; key?</p>