I use xmodmap to swith Ctrl and Alt keys:
~ $> cat .Xmodmap
!
! based on: http://www.emacswiki.org/emacs/SwapControlAltAndCapsLock#toc8
!
!----------------------------------------------------------
! Swap Control and Alt keys, both sides
!----------------------------------------------------------
! First clear all modifiers & control
clear control
clear mod1
clear mod4
! Swap Control_L and Alt_L
keycode 64 = Control_L
keycode 37 = Alt_L Meta_L
! Menu becomes Alt_R Meta_R (AltGr)
! keycode 135 = Alt_R Meta_R
! Define Control_R and Alt_R similar to Control_L and Alt_L
keycode 108 = Control_L
keycode 105 = Alt_L Meta_L
! We need to set keycodes first, as some programs (emacs!) read
! the key names and seem to ignore what's below.
add mod1 = Alt_L Alt_R Meta_L Meta_R
add mod4 = Super_L Super_R
add control = Control_L Control_R
!------------------------------------------
! Caps_Lock becomes an additional BackSpace
!------------------------------------------
! remove lock = Caps_Lock
! keysym Caps_Lock = BackSpaceclear control
! clear mod1
! keycode 37 = Alt_L Meta_L
! keycode 64 = Control_L
! keycode 105 = Alt_R Meta_R
! keycode 108 = Control_R
! add control = Control_L Control_R
! add mod1 = Alt_L Meta_L Alt_R Meta_R
That works fine; however, when I start ibus, the key mappings are overtaken by ibus. Is there a way to avoid this?