As simple as it sounds I can't seem to figure out how to remap Ctrli to be F8.
Reason being is that Emacs recognizes the key sequences Ctrli and Ctrlm to be Tab and Enter respectively.
So for a workaround I'm simply trying to remap the keys Ctrli and Ctrlm to F8 and F9 respectively system wide.

Is there a way to do this?

  • 1
    what? Ctrl-I and Ctrl-M are TAB and CR. – cas Jan 7 '18 at 4:44

In a terminal, the Tab key and Return keys insert the control sequences Ctrli and Ctrlm, respectively. There is no way for an application running in this environment to distinguish them.

Emacs can and does distinguish the keys from their corresponding control sequences in graphical mode, e.g. X Windows. In this case, you can simply use global-set-key or similar as normal.

If you want to use these particular sequences for other things in the terminal, you will have to catch and change the inputs before they reach the terminal. You could use xbindkeys along with xdotool. That would look something like this:

# .xbindkeysrc
"xdotool key --clearmodifiers F8"

"xdotool key --clearmodifiers F9"
  • That's what I opted to do. It sounds like I'd have to mess with the terminal drivers to get the config that I want. And that would make my config less portable in the long run. – John DeBord Jan 7 '18 at 5:44

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.