9

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 ?

  • 1
    Does this occur in all text entering (terminal, web browser, text editor, etc.)? – K.A Dec 26 '13 at 4:03
  • I have the same problem (hence the bounty), and it does occur in all text editing. The problem disappears if I choose a keyboard layout with "dead keys" in the system preferences, but then I cannot typeset accents anymore. – Klaus Dec 26 '13 at 10:30
3

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)

3

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
2
+25

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.

  • Of course, this works, but requires 3 key presses instead of 2. – Klaus Dec 27 '13 at 21:04
  • If this is not a viable solution, you could also take a look at the source code and run a realtime debugger while typing this and seeing what actually runs when you type this. If you know enough code within linux that is. – Crutchcorn Dec 28 '13 at 5:54
  • 2
    I think it is a viable workaround when you need to use it on someoneelses computer and do nto want to fiddle around with their settings. But it is not a good solution for the OP. – Hennes Dec 29 '13 at 15:53
  • Well, naturally this is not a permanent fix; however it is the most viable answer I have to give. :( – Crutchcorn Dec 30 '13 at 18:53
0

I guess it GTK input issue, try different input method with some GTK app:

$ GTK_IM_MODILE=xim gedit

If it will help just export GTK_IM_MODILE variable by adding export GTK_IM_MODILE=xim to your ~/.profile or by other method you prefer.

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.