I'd like to use the right ALT key as 'mod4' (most notably because, by default, the 'awesome' window manager is using mod4 as a modifier for most WM commands and I like that idea a lot).
However I've got an issue: as soon as I add:
xmodmap -e 'add mod4 = Alt_R'
then I cannot use, say, CTRL+ALT+F2 to switch from X to a text console.
(note that I always used left ALT to do that, not right ALT: actually before assigning right ALT to mod4 I was never ever using that key)
It's really a problem with the shortcut / modifiers since that I can still switch from X to a text console by using, say, the chvt command. For example the following always works fine:
chvt 1
As soon as I clear mod4:
xmodmap -e 'clear mod4'
I can use CTRL+ALT+F2 (left ALT once again) to switch to my text console.
But of course then I don't get the nice default mod4+... 'awesome' shortcuts.
So basically I can either use right ALT as mod4 and have awesome work fine or I can clear mod4 (not assigning right ALT to any modifier) and be able to use CTRL+ALT+F2 to swith to a text console.
But I cannot do both.
Do any of you know why configuring right ALT as mod4 prevents CTRL+left ALT+F2 from switching to a text console?
Here's the full xmodmap (when CTRL+left ALT+F2 is not working):
shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_L (0x42), Control_R (0x69)
mod1 Alt_L (0x40), Alt_L (0xcc), Metal_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Alt_R (0x6c)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
Once again clearing that mod4 and I can switch to a text console fine...
I'm not interested in using another setup than:
right ALT as mod4
mod4+... as shortcuts for awesome
CTRL+ALT+F{1,9} to switch to a different VT
Now of course I can use "chvt" to switch to a text console, but that wouldn't work that great should my X be stuck.
I always like to have the possibility to switch to a text console to, say, kill X if it's stuck (been doing that since the early days of slackware).
xev? Also see this answer on Ask Ubuntu – jasonwryan Jul 26 '12 at 3:48removeline to explicitly offload whatever it is initially mapped to before assigning it tomod4. – jasonwryan Jul 26 '12 at 5:22