Attack of the arrow keys

In complex widgets there are often so many possible actions and so little keys. In GtkTreeView this certainly holds for the arrow keys. Since its inception, the arrow keys have been used to move the focus cursor (the dotted rectangle). For GtkTreeView configurations with editable and/or activatable cells (think entries, checkboxes) the left/right keys will allow you to navigate between them. When there is a horizontal scrollbar, the horizonal arrow keys also do scrolling. This makes sense for a lot of people. There is another camp, which claims that left/right should expand/collapse nodes. This is the standard on a lot of operation systems and it does kind of make sense. However in GtkTreeView shift+left/right has been allocated for expanding and collapsing nodes. I've been blocking the idea of making left and right expand and collapse nodes for a very long time, since we really need the arrow keys for moving that focus rectangle. At the beginning of the 2.12 cycle I kind of gave in, since ctrl+left/right was also bound to moving the focus cursor. This basically accompanies ctrl+up/down that moves the focus cursor up/down without changing the selection. And thus left and right now expand and collapse nodes. And guess what, other people now find these new key bindings awkward ;) As examples where this is awkward gconf-editor and tag editors are noted. Now note that both of these are lists, where the usually cited example by the “left and right should expand/collapse” camp are things like nautilus, or any application with a tree and no editable or activable cells. So, as a solution I am currently thinking of the following, to cover both completely different situations and use cases:

  • Left and right moves the focus cursor in lists.
  • Left and right expands and collapses a node if it is a parent. If a node is not a parent and has editable and/or activable cells, move the focus cursor (this will cover testtreefocus even).

When no action is to be done, left and right could scroll as usual. Does any UI person has other suggestions or opinions? Some background information: #105895 – Please add common keybindings for the TreeView #465516 – Impossible to switch cells with the left and right keys

One thought on “Attack of the arrow keys”

  1. I am not a UI person, I am just a plain luser, but here I what I would expect: * Left/Right: collapse/Expand * Up/Down: move into list And the scrolling follows. This seems to me consistant with other tree views on other toolkits.

Comments are closed.