6

Is it possible to assign Shift + Tab to the control key on the right?

jokerdino
  • 41,732
begtognen
  • 1,690

1 Answers1

5

In X11 jargon, the name for a key is called its keysym (short for: key symbol). The keysym generated by Shift+Tab is ISO_Left_Tab. So, in theory, one could just assign the ISO_Left_Tab keysym to any key (which you can do with the command xmodmap) and this would do the trick.

Unfortunately, some applications (for instance: Firefox) explicitly look for the Shift keypress, and this breaks it, because you cannot assign two keysyms (Shift and Tab) to one single key.

Fortunately, Roger Pate's answer to this AskUbuntu question provides a way around it: bind a shortcut to a program that will simulate the simultaneous pressing of Shift and Tab.

  1. Install the xvkbd package

  2. From the System->Preferences->Keyboard shortcuts menu, create a new shortcut, name it e.g. "Shift+Tab" and insert the following command:

    sh -c "xvkbd -text '\S\[ISO_Left_Tab]'"
    

    The purpose of this command is just to send a virtual Shift+Tab keystroke to the currently focused window. (Consult the xvbkd man page for more information.)

  3. Bind this shortcut to any key you want. Note that, to bind a shortcut to a modifier key (i.e., one that is only meaningful in combination with another key, for instance Shift or Alt) you need to deprive it of its modifier status. For example, before binding right-Control, you need to issue this command in a terminal:

    xmodmap -e 'remove control = Control_R'
    

    (See this other AskUbuntu question for another way to bind modifier keys.)

    Note: the xmodmap line above will only have effect until next reboot/logout. To make it persistent, you would have to either put that line into the ~/.gnomerc file, or add remove control = Control_R to the ~/.Xmodmap file.