4

Is there any way to access the Visual Studio Code status bar with the keyboard (i.e. not with the mouse)?

Visual Studio Code status bar

Specifically, I would like to access the Targets:default part, which, as far as I can tell, originates from a language extension (Haskero). I can click on it with the mouse, but I haven't found a way to interact with it using the keyboard.

Obvious attempts like Ctrl + Shift + p, followed by typing status, targets, haskell, and so on, have been dead ends.

Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
  • What is it in the status bar that you want to accomplish? Maybe it can be solved in another way. That is obviously not an acceptable response to the generic part of your question :-). – AndreasHassing Oct 12 '18 at 10:05
  • @AndreasHassing I'm trying to change the compilation target, which is always *default* when I open VS Code. I can do that with the mouse by clicking on *Targets: default*, but I'd like to be able to do that with the keyboard instead. – Mark Seemann Oct 12 '18 at 11:26

2 Answers2

2

You can bind a keyboard shortcut to command haskero.selectTarget:

enter image description here

Mikhail Smal
  • 166
  • 1
  • 4
  • That works, but I'd prefer to not 'use up' a keyboard combination for this. Is there some way I can invoke that command with the keyboard without assigning it an explicit shortcut? – Mark Seemann Oct 11 '18 at 09:26
  • It is missing in the list of registered commands for the command palette: [https://gitlab.com/vannnns/haskero/blob/master/client/package.json#L45](https://gitlab.com/vannnns/haskero/blob/master/client/package.json#L45) – Mikhail Smal Oct 11 '18 at 10:31
0

Keyboard access to the Status Bar has been added in v1.46. See, e.g., https://github.com/microsoft/vscode/issues/97156 and v1.46 pre-release notes

F6 and Shift+F6 will move focus between the major elements of the window in this order:

Editor > Status Bar > Side Bar > Panel

// this is changing to Editor > Panel > Status Bar > Side Bar see change focus of next part

Once in the Status Bar, the arrow keys and Home and End will move between the elements of the Status Bar and space or Enter will trigger the focussed item.

To make the focussed item more obvious you can use this setting:

"workbench.colorCustomizations": {

  "statusBarItem.hoverBackground": "#ff0000"
}
Mark
  • 143,421
  • 24
  • 428
  • 436