My "return" key is broken. I followed the instructions here: http://www.ehow.com/how_2180748_command-linux-swap-keyboard-keys.html - hoping to reassign my | key as the new return key. My .xmodmaprc file reads as follows:

keycode 51 = 36

But the | key does not act as a return key. Nothing has changed. Any ideas what I might be doing wrong? Thanks so much for any suggestions.

  • Have you tried logging in and out? Oct 18, 2011 at 18:43
  • Thank you for replying - I ended up being able to make it work by using Autokey.
    – begtognen
    Nov 1, 2011 at 15:00

2 Answers 2


Your xmodmap expression is wrong. It needs to be formatted like this:

keycode [keycode] = [keysym]

The keysym is the symbol name of the key you want the "|" key mapped to, which in your case is "Return". So your xmodmap expression needs to be:

keycode 51 = Return

Putting everything back together, the command you want to run is:

[~]$ xmodmap -e "keycode 51 = Return"

(Don't type the [~]$ part, I'm just indicating that you need to run that from terminal).

If you want this to run each time you log in create a file called ~/.Xmodmap with the following contents:

keycode 51 = Return

I hope that works.


You need to run the following in a terminal:

xmodmap ~/.xmodmaprc

Your Answer

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

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