Back tab


Shift-Tab is actually BackTab.

While struggling to get the focus movements right in a small application written with Curses::UI, I stumbled upon the need to bind a focusing action to the Shift-Tab input sequence.

It turns out that the available constants are defined in Curses instead. Being a lazy man, I looked around and saw KEY_HOME and KEY_SHOME, so the S must be Shift. Hey! There’s a KEY_STAB here! I found the solution!

Well… not so fast. As I found out here, indeed:

KEY_HOME  Home key
KEY_SHOME Shifted home key

but this S trick is not necessarily universal:

KEY_STAB  Set tab

Uh-oh… OK, let’s find out all the TAB-related entries:

KEY_STAB  Set tab
KEY_CTAB  Clear tab
KEY_CATAB Clear all tabs
KEY_BTAB  Back tab key

There we go! Our Shift-Tab is actually the last one, i.e. KEY_BTAB, which indeed worked for my little focusing problem.

Stay safe and not too lazy!

Comments? Octodon, Twitter, GitHub, Reddit, or drop me a line!