Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The ~ key of my laptop is broken, now I am seeking a method to map the # to it? How could I do it?

share|improve this question
    
It's not clear what you want to change. The only sensible thing I can think of is to bind a different key to the ~ character. This depends on your terminal emulator (xterm, gnome-terminal, konsole, …): what terminal emulator do you use? Maybe you should change the system configuration instead; that depends somewhat on your desktop environment (Gnome, KDE, …). – Gilles Nov 14 '10 at 14:35

Keycode of 3/# key is 12:

]$ xmodmap -pk | grep "(3)"
    12         0x0033 (3)      0x0023 (numbersign)     0x0033 (3)      0x0023 (numbersign)

(xmodmap -pk displays current mapping)

You need to change mapping of this key when pressed with shift so it produces ~ instead of #. You do this like this:

echo "keycode 12 = 3 asciitilde" >> ~/.Xmodmap
xmodmap ~/.Xmodmap

In order to reset mapping back to original you remove above line from ~/.Xmodmap and do:

]$ xmodmap -e "keycode 12 = 3 numbersign"
share|improve this answer

You must log in to answer this question.

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