2

I am trying to change my xfce4 terminal keybindings by editing the accels.scm file. One of the changes I lines I wrote is (gtk_accel_path "<Actions>/terminal-window/next-tab" "<Alt>]"). However, this is not working: it seems that gtk needs me to use some name like "RightSquareBracket" or something of the sort instead of simply "]". The same happens with [ and /. I searched for some list with name-key correspondences for gtk without luck.

Do you know where I can find these correspondences? Or at least what are the strings corresponding to [, ] and /?

1 Answer 1

1

Launch xev, press the key and use the 2nd value inside the parenthesis in the 3rd line:

KeyPress event, serial 38, synthetic NO, window 0x4200001,
    root 0x7b9, subw 0x0, time 18425452, (520,545), root:(522,547),
    state 0x0, keycode 51 (keysym 0x5d, bracketright), same_screen YES,
    XLookupString gives 1 bytes: (5d) "]"
    XmbLookupString gives 1 bytes: (5d) "]"
    XFilterEvent returns: False

You'll find bracketleft and slash for the other ones. Thus

(gtk_accel_path "<Actions>/terminal-window/next-tab" "<Alt>bracketright")

A worse alternative is to look into /usr/include/X11/keysymdef.h, where you will find lines such as

#define XK_bracketright                  0x005d  /* U+005D RIGHT SQUARE BRACKET */
3
  • Still not working, but I believe your answer is correct. (none of the edits I make to accels.scm seem to have an effect, so the problem is not with the naming of the keys)
    – Soap
    Apr 20, 2021 at 15:17
  • @Soap Oh, sorry to hear that. {1} What is the terminal version? I'm testing on 0.8.10. {2} Is the full path ~/.config/xfce4/terminal/accels.scm? {3} Did you try to open a new terminal before trying the new binding? {PS} Sorry if any of those questions seem stupid, I just want to rule out some possible reasons.
    – Quasímodo
    Apr 20, 2021 at 19:47
  • 1. I'm using the same version. 2. Yes, that's the full path. 3. I did. Although: it seems that some changes that I did last week are indeed working. Since I only reboot my computer once a week, it may be needing another reboot. I will try it when it is not inconvenient. {PS} They don't sound stupid to me :)
    – Soap
    Apr 21, 2021 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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