1

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?

curtis
  • 23
  • 6

2 Answers2

0

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
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="de"
XKBVARIANT="nodeadkeys"
XKBOPTIONS="caps:escape"

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.

Ingo
  • 42,107
  • 20
  • 85
  • 197
0

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.

Botspot
  • 1,759
  • 6
  • 27
  • 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 '19 at 18:00