9

How can I map Ctrl+Backspace to behave as Delete key with xkb? I can remap a single key on /usr/share/X11/xkb/symbols/pc but can't figure out how to do the combination. My OS is Ubuntu 15.04

  • 1
    Does this thread's answer work for you? – user1717828 May 23 '15 at 14:03
  • @user1717828 Not really, the config is just too cryptic, I need a more specific answer. – Caballero May 23 '15 at 14:11
  • Also asked on Ask Ubuntu: askubuntu.com/questions/627310 – JdeBP May 23 '15 at 20:01
  • I thought this might work with xmodmap, but is does not. Apparently (and this is new to me, since I never needed or tried this) Ctrl cannot be used as a modifier which changes the character a key generates. – Ned64 May 24 '15 at 7:41
8

As Gilles pointed out in a comment, you can do it with xkb if you change the type of BKSP key to control-modifiable. Example: if I edit /usr/share/X11/xkb/symbols/pc and under:

    include "pc(editing)"
    include "keypad(x11)"

change this line:

    key <BKSP> {   [ BackSpace, BackSpace  ]   };

to:

    key <BKSP> {
        type="PC_CONTROL_LEVEL2",
        symbols[Group1]=  [ BackSpace, Delete ]
    };

then Ctrl+Backspace behaves as Delete.

  • I've done this change, deleted /var/lib/xkb/server-* files, rebooted and the keyboard was not responding, couldn't even log in. I've reverted the change by booting from a live USB. What could be the problem? – Caballero May 24 '15 at 8:13
  • Sorry, it was my fault - missed the semicolon at the end. It works. – Caballero May 27 '15 at 20:47

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.