I have a Mac keyboard where the Alt/Win (i.e. Option/Command) keys are inverted compared to a regular PC keyboard, and I'd like to swap them. I haven't had any luck with xmodmap so far. The standard configuration is as follows:

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

Currently, the left/right alt keys are keycodes 64 and 108, while the left/right windows keys are 133 and 134.

I appreciate any help!

link|improve this question
feedback

migrated from stackoverflow.com May 2 '11 at 12:22

This question came from our site for professional and enthusiast programmers.

1 Answer

This is my Xmodmaprc:

! Exchange left Alt and left Win
remove mod1 = Alt_L
remove mod4 = Super_L
add mod1 = Super_L
add mod4 = Alt_L
! Exchange tilde and lesser/greater
keycode  94 = grave asciitilde dead_grave dead_tilde grave asciitilde
keycode  49 = less greater less greater bar brokenbar bar brokenbar
! Steve, your keyboard sucks

You'll have to modify your .xsession or .xinitrc to call xmodmap .Xmodmaprc

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.