Knowing the state of the keyboard in a VS Code extension

47 views Asked by At

I want to read the state of the keyboard in a VS Code extension and be able to run action A or B depending on whether a modifier key like Shift or Option/Alt is currently pressed.

Is there a way I can read the keyboard? I seem to find no information on this on the API reference.

1

There are 1 answers

0
alefragnani On

If your need is for commands that your extension contributes, then unfortunately, there is no API available, yet. I have opened this issue (https://github.com/microsoft/vscode/issues/18064) a while ago asking for something very similar, and it is on the Backlog, but no ETA.