tags:

views:

1437

answers:

4

I started using xmonad as my window manager a couple of weeks ago. I love it. Its great. But since then I have had to use 'ESC' key a lot when I am in emacs and want to press the 'ALT' key. This is because 'ALT' key is used by xmonad as the 'mod' key.

Is there a way to assign the emacs mod key to anything other than the 'ALT' key like assigning it to the 'windows' key.

Any help would be higly appreciated.

Thanks, Vimal

P.S. this is the keyboard I am using http://tinyurl.com/c4955o

+4  A: 

Actually, it would be much easier to assign Xmonad's mod key to be the "Windows" (super) key. It's what I do!

Here's how:

Xmonad FAQ

J Cooper
Thanks for the help. I was able to set the 'windows' key to be the mod key in xmonad. But in emacs the 'ALT' doesn't seems to work. It prints weird characters, when I use the 'ALT' + key chords.
Vilmorin
That is unusual. I'm no guru, but some more information would help: what exactly is your setup (OS, are you running Xmonad within gnome, etc.)? Are you running the X version of Emacs or in a terminal? If the latter, which terminal program are you using?
J Cooper
* OS : Red Hat Linux Enterprise Edition* Window Manager : XMonad (Not using gnome)* Emacs is run from the terminal created from XMonad using mod+shift+enter* Emacs is run as 'emacs -nw'
Vilmorin
Going to bet that it's a problem with the terminal that XMonad is launching; note that this is configurable (I think I have mine using "gnome-terminal"). To confirm, install the X version of GNU Emacs for a minute, and see if Alt is working properly there.
J Cooper
Yes. This fixed my problem. I am gnome-terminal now. thanks a lot.
Vilmorin
+1  A: 

emacs commands are often show M-/ which means hold the Meta key, and press forward slash. You need to use xkeycaps to figure out which key on your keyboard is assigned the META modifier, and that's the key you want to use for META key chords.

Also, xkeycaps lets you assign the META modifier to whatever key you like, so if you don't like the way it's setup, you can fix it.

You will probably want to read the xkeycaps man page thoroughly, or post more questions here, if you set META to some places, GNOME won't pick up the META key correctly, but I've forgotten exactly what problems I had.

shapr
A: 

You can configure xmonad to use Emacsey key sequences instead of the default Mod-X or Mod-Shift-X. Details are here.

Alexander Kojevnikov
A: 

Bindings starting with Alt modifier often conflict with applications, so the first modification I always make to XMonad configuration is to change the modifier to the Super (Windows) key.

modMask = mod4Mask

I like the idea that everything associated with window management is assigned to a modifier used just for this purpose, this makes it conceptually isolated and easier to remember.

More details can be found in a great tutorial on configuring XMonad.

Adam Byrtek