1

My keyboard switches the (German) keys [^] and [<], so I want to switch the two keys.

I identified the keycodes using xev and created a file ~/.xmodmap containing

keycode 94 = asciicircum degree
keycode 49 = less greater

When executing xmodmap ~/.xmodmap hardware key 94 now correctly outputs "^" instead of "<". Unfortunately the other key does not output any character at all.

xev returns the following output when the key is pressed

KeyRelease event, serial 32, synthetic NO, window 0x2e00001,
    root 0x4b, subw 0x0, time 258843335, (169,-12), root:(185,111),
    state 0x4000, keycode 49 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

do you know what the problem might be?

As far as I understand it the man page says that remove only works for modifiers, but I don't care for modifiers, I want to switch regular keys. Might there be another problem that is not related to that 'possible duplicate'?

Braiam
  • 35,380
  • 25
  • 108
  • 167
muffel
  • 2,678
  • 4
  • 23
  • 21
  • 1
    See the dup, you need to remove them and then map them afterwards. – slm Mar 09 '14 at 14:32
  • @slm The answer marked as duplicate is about modifiers, mine is about regular keys. The man page says remove only applies to modifiers. – muffel Mar 10 '14 at 13:59
  • If you take out the `keycode 94 =` can you get the `keycode 49 =` to work at all? I see what you're talking about in the man page, but before we reopen I just want to be sure, so please bear with me. I'm wondering if you're missing a keysymname on the right side. Also did you try generating a xmodmap file on your system directly? I believe it's `xmodmap -pk`. – slm Mar 10 '14 at 14:24
  • @slm No, keycode 49 just doesn't work. I tried to use `xmodmap -pke` after a fresh reboot to print the current configuration and created a new input file by just switching the numbers 49 and 94, but still only 94 works. – muffel Mar 10 '14 at 16:13
  • Ah OK, so there is definitely something else awry here. – slm Mar 10 '14 at 16:39

1 Answers1

0

Although this is a very old question, it seems to be still relevant today (at least I was facing the same problem) and solved it with this .Xmodmap file:

keycode 49 = less greater less greater
keycode 94 = dead_circumflex degree dead_circumflex degree

The "repetitions" are the mappings for caps-lock.The dead_circumflex allows the creation of accented characters, e.g., ^ followed by e will create ê, while asciicircum just emits the plain character ^.

Hope this helps.

Konrad Holl
  • 121
  • 6