My Logitech Keys-to-Go bluetooth keyboard does not have an ESCAPE [ESC] key. I discovered that I can use the "ctrl-[" keyboard combination as a workaround to get [ESC] functionality with this keyboard.

Is there a way to remap one of the other keys to send "ctrl-[" as a single key press instead of using a keyboard combination?

2 Answers 2


According to this answer, you can remap the keys using xmodmap.

in your case it would probably be xmodmap -e 'keycode 66=Escape'.
by the way: if you don't want to type the command every time you login manually, you can insert the line into your .bash_profile and it is executed automatically with your login.

  • Great answer! The command you suggested mapped to the caps-lock key. I'll add it to my .bash_profile to make it automatic.
    – curtis
    Sep 13, 2019 at 18:00

In /etc/default/keyboard you can configure the keyboard and also set options. For example here is my favorite keyboard setting:

rpi ~$ cat /etc/default/keyboard

# Consult the keyboard(5) manual page.


As you can see with XKBOPTIONS="caps:escape" I changed the capslock key to work as an additional ESC key. This may also be usable with your keyboard. Description of all available keyboard models, layouts, variants and options is available in /usr/share/X11/xkb/rules/xorg.lst. Look there at the section ! option.

In man keyboard you will find:

In Debian systems the default keyboard layout is described in /etc/default/keyboard and it is shared between X and the console.

So the settings are also reflected in X sessions. I can confirm this at least for version Stretch and Buster.

  • I don't think this works within the X session. See here.
    – Botspot
    Sep 13, 2019 at 16:54
  • @Botspot It definitely works in Stretch and Buster also in the X session. I have updated my answer.
    – Ingo
    Sep 13, 2019 at 17:05
  • Good to know. Probably outdated information.
    – Botspot
    Sep 13, 2019 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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