1

I would like to rebind next/previous tab shortcut in XFCE's Terminal from Ctrl+PgDn/PgUp to Ctrl+Tab/Ctrl+Shift+Tab. It doesn't seem to work either by editing accels.scm or changing the shortcut interactively by hovering over the menu and pressing the desired key combo.

Other keys work fine for this, it's just shortcuts that involve Tab that are a problem. I assume these are special to GTK and don't even reach the application. Is there a way to override this?

1

You can't use Tab key for shortcuts, at least in Xfce Terminal.

Direct answers

[...] it's just shortcuts that involve Tab that are a problem. I assume these are special to GTK and don't even reach the application.

Your assumption is correct. The limitation actually applies to GTK+ application programs and Xfce Terminal is one of them. And it's not just shortcuts that involve Tab key, but also few other keys i.e. PageUp, PageDown, F10 that cannot be used individually (without modifier key).

Is there a way to override this?

Likely no, although workaround may exist. A better way is to look for alternatives to Tab key, or use other application programs that allows it. See also the following explanations.

Explained by contributors

First, there is dated bug 3524 that reported "Next/previous tab keyboard shortcuts does nothing". The most relevant comment has been quoted below.

[Comment 9: Nick Schermer 2009-10-10 13:49:08 CEST]

Xfwm and terminal use a different way if handling accelerators (xfwm directly from x, terminal relies on gtk). is in gtk handled as an invalid accelerator, so to 'fix' this terminal will check if the accelerator is valid before setting it. As a result pressing will do nothing in the shortcuts editor from now on.

Second, there is dated post on Stack Overflow that asked "PyGTK: Allow usage of Tab in AccelGroup". Relevant part of question has been quoted below.

When using gtk.AccelGroup any combination with Tab charater is invalid. Now I do understand that UI navigation is done using this key [...]

Explained by documentation

Regarding "UI navigation is done using this key", GNOME Developer documentation has noted the matter in topic of Keyboard input as quoted below.

Keyboard navigation

[...] Tab is the standard key for moving around an interface with GTK+ and GNOME.

Additionally, shortcuts that use Tab key have dedicated functions.

Standard navigation keys

Tab and Shift+Tab Moves keyboard focus to the next/previous control

Ctrl+Tab and Shift+Ctrl+Tab Moves keyboard focus out of the enclosing widget to the next/previous control, in those situations where Tab alone has another function

Ctrl+Tab and Shift+Ctrl+Tab Moves keyboard focus to the next/previous group of controls

So earlier comments make sense now.

Revised answer (2017.04.04)

Despite Tab key is recognized as ^I in the command-line shell for tab completion, it has least relevance with inability to use Tab key as shortcut in graphical application programs.

Why Tab key cannot be used as a shortcut? The reason was simple: Tab key and its combination keys are reserved by GTK+ and GNOME.

Despite GNOME Terminal via GSettings allows to use Tab key for shortcuts, there is no equivalent hack for Xfce Terminal via Xfconf to this answered date.

  • 1
    Yes, Tab is interpreted by the shell, but that your lengthy explanation doesn't address my question: why can't Ctrl+Tab be used as a shortcut? – Davor Cubranic Mar 29 '17 at 20:58
  • Looks like I didn't fully comprehend the question. So this may be Xfce or GTK+ specific issue. Need to research further before revising the answer. – clearkimura Mar 30 '17 at 16:56
  • Revised my answer. While the reason was simple, I couldn't find any straightforward answer. I had to quote text from several sources, which makes my answer lengthy anyway. – clearkimura Apr 1 '17 at 18:06
  • Thank you for the update: you are right, it's the GTK that reserves the Tab combo in accelerators, so the apps can't use it without tricks (like Pidgin does): bugzilla.gnome.org/show_bug.cgi?id=123994. – Davor Cubranic Apr 4 '17 at 6:08
  • 1
    Also, someone figured out a workaround with gnome-terminal using "<Primary>Tab" and "<Primary><Shift>Tab": bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/162000/…. Could something like that be used in xfce-terminal too, I wonder? – Davor Cubranic Apr 4 '17 at 6:10

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.