Key mapping reverts to default after changing keyboard layout in KDE
Hi. I'm using small keyboard (Media-Tech MILAN) which doesn't have right CTRL key, so I've decided to assign CTRL at two (because they are both small :)) other keys (Win-key and Menu-key) on the right half of the keyboard.
I've done this successfully with "xmodmap" program, by creating a file "~/.Xmodmap" with the following contents:
In KDE I've had first to set manually a file-url in "~/.kde/Autostart", so command "xmodmap ~/.Xmodmap" would be executed automaticaly every time KDE start. And it worked until I've had to change keyboard layout to say, Serbian (another keyboard layout besides the english one, was added in Settings->Regional & Accesibility->Keyboard Layout) after which all keys that should act like CTRL "synonym" were reverted at their default state (Win-key was Win-key, not CTRL, and also Menu-key was Menu-key and not CTRL like ti was supposed to be), even when I after that, changed layout back to english.
With a little digging, I saw that the reason for this behaviour is because KDE always calls "setxkbmap" with every keyboard layout change, which reverts keys to their default mapping. But, even after layout change I cannot set intended mapping by calling "xmodmap ~/.Xmodmap" if directly before it was'nt called "setxkbmap" (with some options). Now, I've been trying to change change mapping of those two keys with "setxkbmap", although, I would'nt know what to do with it, since I cannot alter directly the way KDE calls that command on layout change, but nevertheless with no success. Commands "setxkbmap -option win:control", "setxkbmap -option win:ctrl", "setxkbmap -option control:win", "setxkbmap -option ctrl:win"... Have'nt gave any usefull result.
Temporarily I've made an extra button on the panel, which I have to press after I change keyboard layout (from English to Serbian or vice versa), and button itselfs executes a simple script:
In "Settings->Regional & Accessibility->Keyboard Layout->Xkb Options" is also set "Alt and Meta are on the Alt keys (default)" because without this even the right Alt key does'nt behave like expected, although I could probably solve this also with "xmodmap" command by adding the line "keycode 113 = Alt_R" in "~/.Xmodmap" file, at least until keyboard layout does'nt change.
So to put it simple, I'm interested does anyone knows how can I map CTRL on those two keys (Win-key and Menu-key), but which would be retained even after keyboard layout changes.
|All times are GMT -5. The time now is 02:05 AM.|