View previous topic :: View next topic |
Author |
Message |
stephandale Tux's lil' helper
Joined: 28 Jan 2006 Posts: 86
|
Posted: Wed Apr 13, 2011 12:23 pm Post subject: xmodmap modifiers |
|
|
Hi all. I've a question about xmodmap modifiers...
Background
xmodmap specifies keycodes as a series of keysyms. From the man page... "The first keysym is used when no modifier key is pressed in conjunction with this key, the second with Shift, the third when the Mode_switch key is used with this key and the fourth when both the Mode_switch and Shift keys are used." As far as I can determine, the other keysyms are ignored.
xmodmap also allows you to specify modifiers mod1, mod2, mod3, mod4 and mod5.
Question
Does xmodmap specify these modifiers simply so they can be used by other applications, or is there a way of configuring how they're used from the xmodmap setup?
For example, I've got mod4 set to be Super_L, which is the Windows button on my keyboard. Is it possible to use xmodmap to configure the j key to send Left when combined with mod4?
Example
If I wanted Shift-j to send Left, I'd just put Left in the second position of j's keycode line:
keycode 44 = j Left j J ...
I'd like to do something similar with mod4/Super_L instead of Shift.
Thanks. _________________ Stephan Dale
http://mindspill.net/computing/linux-notes/gentoo/
gentoo(a)mindspill.net |
|
Back to top |
|
|
stephandale Tux's lil' helper
Joined: 28 Jan 2006 Posts: 86
|
Posted: Thu Apr 14, 2011 9:44 am Post subject: |
|
|
I've found a partial solution. I could remap the Windows key to be the Mode_switch, allowing me to remap h j k l to Left Down Up Right (when holding the Windows key).
1. Use the xev command to determine the keycode of the Windows key. On my keyboard it's 133.
2. Map key 133 to Mode_switch.
3. Add the navigation commands to the keycodes for hjkl in my .Xmodmap, as follows...
Code: |
keycode 133 = Mode_switch
keycode 43 = h H Left H hstroke Hstroke
keycode 44 = j J Down J j J
keycode 45 = k K Up K kra ampersand
keycode 46 = l L Right L lstroke Lstroke
|
(the other commands hstroke, Hstroke etc were already present, as determined by running 'xmodmap -pke').
This isn't an ideal solution because the Windows key is no longer mapped to Super_L, which means I can't use it as command modifier in compiz (via ccsm). So still investigating.
P.S. It's wise to create a reset map, so you can undo any changes you made in case you screwed something up...
Code: |
xmodmap -pke > .Xmodmap.reset
xmodmap .Xmodmap.reset
|
_________________ Stephan Dale
http://mindspill.net/computing/linux-notes/gentoo/
gentoo(a)mindspill.net |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|