Add a new modifier key
Got Compiz Fusion up and running today, sweet. Now I'm planning to dedicate the Caps Lock key to window management, thus turning it to a modifier key.
"Wait a minute", you say, "this has been answered like 10000 times before if not more!" And you are right, I apologize for brining such a common "trick"/question up again; I've search for a while, both here and using Google, but still haven't found a solution.
So what's the problem?
I don't want to switch keys or remap caps lock to an existing key. I want a new modifier key. Obviously, xmodmap is the answer. I ran it and got
So why are you asking for help then?
Because, apparently, my applications don't like the new key. When trying to map a shortcut in KDE applications, it simply doesn't react when I press the caps lock key (which should have shown as "Hyper").
Better luck with CompizConfig Settings Manager (K version) then? Kind of. I can map actions to "Hyper+something", but when I press the combination, nothing happens.
That's how far I've gotten. It feels like I've made a stupid mistake somewhere, instead of trying for hours and finally realizing it I beg for your help instead.
If the Hyper key isn't any good, I've thought of another possible solution: map caps lock to <Control><Super><Shift><Alt>. Is that possible? So when I press the caps key, it's like pressing the four modifier keys, creating a "new" modifier key.
As always, thanks in advance.
I think X Window System uses its own keymap which may change what you set in bash. If you are using Xorg 7.x, you can use custom key code option in your /etc/X11/xorg.conf file. Also you can place a file in your home directory, so KDE runs it when you log into it. I think KDM, a display manager, also provides a way to set custom key maps. Probably the xorg.conf way will be the best way.
I do not use KDE because it is too bloated, so check its documentation or ask a KDE developer.
Just remember, what you set in virtual terminal will not work for other programs. Every virtual terminal and every program that you run gets its own environment. Linux is a multi-task OS which means it runs many tasks with the same default environment that is separated by other programs.
Right now I wonder if it isn't a KDE issue; Hyper isn't listed as a modifier key under "KDE Modifiers". Does anyone know how to add it there?
I would also like to know this.
how to add a modifier
This is an excerpt from the Xmodmap man page in Ubuntu and might be the clue of how to do this:
This removes all entries in the modifier map for the given
modifier, where valid name are: Shift, Lock, Control, Mod1,
Mod2, Mod3, Mod4, and Mod5 (case does not matter in modifier
names, although it does matter for all other names). For
example, ‘‘clear Lock’’ will remove all any keys that were
bound to the shift lock modifier.
add MODIFIERNAME = KEYSYMNAME ...
This adds all keys containing the given keysyms to the
indicated modifier map. The keysym names are evaluated after
all input expressions are read to make it easy to write
expressions to swap keys (see the EXAMPLES section).
remove MODIFIERNAME = KEYSYMNAME ...
This removes all keys containing the given keysyms from the
indicated modifier map. Unlike add, the keysym names are
evaluated as the line is read in. This allows you to remove
keys from a modifier without having to worry about whether or
not they have been reassigned.
I think you've missed a few steps. I haven't messed around with hotkeys lately, but when I wanted to add a key on Debian Lenny, the full process I used was:
Use xev to find the keycode, which was in this case the standard 115
Edit /usr/share/X11/XKeysymDB so it knows there's a new key for it to deal with on the keyboard:
added to the end of the file
Create the file /etc/X11/Xmodmap to link the Start key to keycode 115:
keycode 115 = Start
To get xmodmap to actually load the file you just created, near the end of the file /etc/X11/Xsession add:
[ -f /etc/X11/Xmodmap ] && xmodmap /etc/X11/Xmodmap
Hope something in that helps!
|All times are GMT -5. The time now is 01:00 AM.|