I put xmodmap -e 'keycode 97 = backslash' into a script that is executed at startup. My hardware is a Japanese keyboard, so it lacks some keys and has some extra ones and I am trying remap some of the keys that are missing to some of the keys that are new. This however shows some erratic behaviour when also using different keyboard layouts at the same time. I have currently four layouts, and the remapping works on two of them (Polish and Japanese) (although it is not strictly speaking a remapping for the Japanese keyboard layout).If I execute the command again it works on all the layouts. This remapping: xmodmap -e 'keycode 101 = at Pointer_Button3' still does not work for all the layouts (only for the English and German layout), even after executing it again. I don't really understand how the different ways of changing the keyboard layout interact, so I guess my questions are:Why does this behave so weirdly?How can I get the second command to work on all layouts?How can I get this to work at startup, without having to execute some of the commands again? Maybe I have to set a timer or something?I am using Kubuntu 14.04., but I guess this is not an Ubuntu-specific problem, so I posted it here instead.
Remap Keys for ALL layouts
x11;keyboard layout;xmodmap