Skip to main content

Thread: Could someone explain xmodmap's modifier, clear, and remove features to me?


hi,

been reading alot xmodmap, i'm still bit unclear.

sole goal following on macbook pro keyboard:

make alt_l key windows key (i think it's super_l)
make left command key alt_l key.
make right command key alt_r key.
make alt_r control_r key.

in other words, want standard keyboard layout.

know need either clear or remove in xmodmap. difference between these commands , how used, , do? don't understand modifier key in terms of xmodmap's usage.

gather steps this:

clear modifiers in xmodmap (what mean?)
assign keysymbol keycode. (i understand this)
add modifier? (i don't @ all)


have seen code snippet follows:

code:
! swap alt , cmd keys. keycode 37 =    control_l  keycode 133 =   alt_l meta_l   keycode 64 =    super_l  keycode 108 =   super_r  keycode 134 =   iso_level3_shift multi_key  keycode 105 =   control_r       multi_key   clear shift  clear lock  clear control  clear mod1 clear mod2  clear mod3  clear mod4  clear mod5   add    shift   = shift_l shift_r  add    lock    = caps_lock  add    control = control_l control_r  add    mod1    = alt_l 0x007d  add    mod2    = num_lock  add    mod4    = super_l super_r  add    mod5    = mode_switch iso_level3_shift iso_level3_shift iso_level3_shift    ! configure '=' key on numpad '='.   keycode 0x7d =  equal
if can explain lines in great detail may have idea what's going on. on natty, it's worth.
thanks!

if going write xmodmap file need proper keycodes , modifiers. want keyboard defaults


code:
xmodmap -pke | grep -i "alt\|meta\|control" xmodmap -pm
or use xev find keys need. simple program test configurations, might still need xmodmap -pm

there 2 ways swap keys. first keysym , other keycode.
thing keysym not need know each keycode write script, logging out , loggin in cause keys keep swapping. in case, may want conside using keycode perment solution. writing write both you.

modifiers events interpreted xserver. forgetting remove modifier can lead strange behaviors in programs. btw understanding how modifier works confusing part of xmodmap.
http://www.emacswiki.org/emacs/xmodmap
http://www.emacswiki.org/emacs/metakeyproblems#toc7


run save in file , run
code:
xmodmap wateveryounamedthefile
here example on how swap caps lock , left control.
btw in xmodmap configuration files "!" comments
code:
! ! swap caps_lock , control_l ! remove lock = caps_lock remove control = control_l keysym control_l = caps_lock keysym caps_lock = control_l add lock = caps_lock add control = control_l
http://www.acm.uiuc.edu/workshops/co...x/xmodmap.html

here basic script made swap escape caps lock
code:
remove lock = caps_lock keycode 66 = escape  keycode 9 = caps_lock add lock = caps_lock


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [all variants] Could someone explain xmodmap's modifier, clear, and remove features to me?


Ubuntu

Comments