Question

This question is a general version of my previous question: Change the escape sequence generated by xterm for key combinations. I've got a good answer on how to change the escape sequences generated by xterm (changing its conversion table by an .Xresources file in home dir).

Now I would like to know if there is a more general way of changing the generated escape sequences in linux (Ubuntu/CentOS). By this I mean that I would like the change to apply not only for xterm but for gnome-terminals too. I am thinking of terminfo to do this but I tried and modified, recompiled the terminfo but could not achieve to get a ^[O5Q response for pressing Ctrl+F2 in terminal.

I also tried the followings without success:

  • xmodmap, but for key combinations it's not working
  • xdotool windowactivate xyz type ^[O5P, this returns the char codes of individual characters
  • xmacro, it doesn't send keystrokes to other window
  • ironahk, I get an error right at the start with trying to run the example.ahk and couldn't find the commands that I wished for in its light manual.
  • bind '\e[1;5P":"\e[O5P"', here the first keycode is what I currently get when typing ctrl+f1 and after the one that I wish to get by this combination. No effect.
  • xbindkeys + xvkbd, didn't helped either

Thanks in advance.

Était-ce utile?

La solution

There is no universal way to do this. Each terminal widget (VTE, etc.) has its own method for translating keypresses into character sequences, and some may even hardcode it in the code itself.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top