I would like to set my Alt_L to trigger a meta key in emacs.
I've tried using xmodmap to set Alt_L as Mod1, Mod2, Mod3. But in emacs, when i try to type Alt_L + x (expecting M-x) it only prints "x".
I start X server with : setxkbmap -model pc105 -layout us,fr -option grp:alt_shift_toggle -option caps:none
When I print the modifiers with xmodmap -pm
I get :
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_L (0x42), 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)
I feel the problem comes from emacs, not from X keyboard config.
How emacs handles those modifiers ?
EDIT: setxkbmap -query
ouputs when I start X:
rules: evdev
model: pc105
layout: us,fr
options: ctrl:nocaps,grp:alt_shift_toggle
Using xev
when I type Alt_L then x, then release x and release Alt_L I get:
KeyPress event, serial 34, synthetic NO, window 0xc00001,
root 0x1d9, subw 0x0, time 5433348, (-2,510), root:(640,512),
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 34, synthetic NO, window 0xc00001,
root 0x1d9, subw 0x0, time 5438940, (-2,510), root:(640,512),
state 0x8, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes: (78) "x"
XmbLookupString gives 1 bytes: (78) "x"
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0xc00001,
root 0x1d9, subw 0x0, time 5439004, (-2,510), root:(640,512),
state 0x8, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes: (78) "x"
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0xc00001,
root 0x1d9, subw 0x0, time 5442460, (-2,510), root:(640,512),
state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False