Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xmodmap modifiers
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
stephandale
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jan 2006
Posts: 86

PostPosted: Wed Apr 13, 2011 12:23 pm    Post subject: xmodmap modifiers Reply with quote

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
View user's profile Send private message
stephandale
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jan 2006
Posts: 86

PostPosted: Thu Apr 14, 2011 9:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
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