I prefer backspace right above "enter". In windows this can be accomplished with autohotkey. On my desktop a HKKB keyboard has this layout built-in.

Following Custom keyboard layouts (Ubuntu) has me swapping <BKSL> and <BKSB> in usr/share/X11/xkb/symbols/pc. This yields the behavior that both backspace and backslash enter a backslash, rather than swapping the keys functionality. Swapping via xcape -e 'BackSpace=backslash' and its alternate will insert then delete a backspace.

How can backspace and backslash be swapped in Ubuntu?

1 Answer 1

$ echo -e "keycode 22 = backslash \n keycode 51 = BackSpace" | xmodmap - 
  • Almost perfect, how to get "shift+BackSpace" to return bar? The modifier doesn't translate. Dec 6, 2017 at 20:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .