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?

$ 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 '17 at 20:30

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.