Exponent replacement (^2 -> ²)

In my freshly installed Debian 7 system, every time I type on the keys ^ then 2, I get ² (ASCII character for "squared"). The same is true with 2 replaced by 3 to 8.

How could I desactivate this to get ^2 instead, as in Mac OSX ?


Solution 1:

Perhaps a compose key setting? Are you using Gnome, by chance?

Try checking the files listed here; /usr/share/X11/locale/compose.dir and /usr/share/X11/locale/en_US.UTF-8/Compose (the latter may change based on the first; see the link for more details)

Solution 2:

You can try to use xmodmap for this, some useful info is at the ArchWiki xmodmap page. Basically, this is a utility to manage your keyboard mapping in X. For your specific question, you could do something like

xmodmap -pke >mycustommodmap

to get the current settings first. On my system, the 'bad' keypress caused something called dead_circumflex, which could be found in that file. After changing this to asciicircum, and loading the new map with

xmodmap mycustummodmap

the key now immediately produces a ^.

To make sure that this is automatically done when you login, you could set the name of the file to .Xmodmap in your home directory. If it doesn't get loaded automatically then or you don't want to name your file that way, you should be able to instruct your desktop to run the specified command at startup somehow.

Edit

Actually, although getting the current map first is a good place to start, you don't need all those lines in your .Xmodmap, just the ones you'd like to change. For example, in my .Xmodmap, to change the behavior for ^ (circumflex) and ~ (tilde), the contents are just

keycode  34 = asciicircum dead_diaeresis dead_circumflex dead_diaeresis bracketleft dead_abovering bracketleft
keycode  61 = equal plus equal plus asciitilde dead_abovedot dead_tilde

Solution 3:

Try tricking the computer. I have had this issue many times before and it can be tricked by typing '^' pressing space, then adding another space right after ^, then a 2, then erase the space between them and clicking after '^2' it's worked for me before on occasion but is concurrence. Give it a shot.