You are not logged in.

#1 2011-04-04 22:13:24

Markus00000
Member
Registered: 2011-03-27
Posts: 318

[SOLVED] xmonad: modMask = AltGr?

The only values I have seen for modMask are mod1Mask, mod2Mask and mod4Mask. As I did not find a list of possible values: Can AltGr be used? What's its name?

I'd also like to know how I could have found this list. smile

Last edited by Markus00000 (2011-04-07 18:39:42)

Offline

#2 2011-04-05 16:15:12

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [SOLVED] xmonad: modMask = AltGr?

altGr == mod1Mask  in most cases.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2011-04-05 16:32:19

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] xmonad: modMask = AltGr?

In my case: mod1Mask == Alt

Offline

#4 2011-04-05 17:10:38

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: [SOLVED] xmonad: modMask = AltGr?

You may want to use `xmodmap' and bind Alt_R to Mod5 (I don't think it's used by default), like so:

# ~/.xinitrc
xmodmap -e "add Mod5 = Alt_R"
exec xmonad
-- ~/.xmonad.hs
....
   modMask = mod5Mask
....

Anyway, if the xmodmap command doesn't work, try using `xev' to discover keycode and map it to whatever key you want, e.g. open 'xev' press the key you want to map, read the keycode, close xev and alternatively, you could add it to Mod1 and use modMask = mod1Mask, like

# ~/.xinitrc
xmodmap -e "keycode NUM = Alt_R"
xmodmap -e "add Mod1 = Alt_L Alt_R"
exec xmonad

(NUM should be the keycode you discovered through `xev').  Though you might have to clear the Mod first, like

# ~/.xinitrc
xmodmap -e "keycode 64(or whatever your Alt_L is) = Alt_L"
xmodmap -e "keycode NUM = Alt_R"
xmodmap -e "clear Mod1"
xmodmap -e "add Mod1 = Alt_L Alt_R"
exec xmonad

Some ideas, anyway, since AltGr on my keyboard is already mapped to Alt_R so I'm assuming that's what it should be mapped to.  There's Arch wikis for "xmodmap" and "extra keyboard keys" for more reading.  If I had the wrong idea about this, I apologize.

Last edited by milomouse (2011-04-05 17:15:34)

Offline

#5 2011-04-05 20:24:28

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] xmonad: modMask = AltGr?

milomouse, thanks a lot for your detailed help! Well, AltGr still did not work... Therefore I decided to stick with Alt. After reading the docs about xmodmap, I remapped the other modifier keys so that Alt is now quite convenient. Not [solved] but [happy]. Thanks!

Offline

#6 2011-04-05 21:11:25

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: [SOLVED] xmonad: modMask = AltGr?

Well, at least you're happy.  tongue  Regardless, I wished it could've been solved for you as I went through the same setup and it worked for me (testing it out on XMonad).  Anyway, to see a list of modifiers and what they're assigned to you can also type `xmodmap -pm'.  Turns out, on my system mod5 is already assigned and mod3 isn't, but each modifier can have up to 4 keys so that could prove useful.  I just try to avoid using Alt_L as a modifier since other programs usually have that key bound to certain actions, but if you don't use those sort of hotkeys then it shouldn't be a problem.

Offline

#7 2011-04-06 07:38:27

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] xmonad: modMask = AltGr?

Yes, the usefulness of Alt_L as a modifier heavily depends on the applications you use. Well, AltGr isn't perfect, too, as the default xmonad shortcuts overlap with some keys on international keyboards. Either way is possible but neither without effort. The good old Windows keys are probably the ones that need the least remapping. Thanks for the other tips you posted.

Offline

#8 2011-04-06 14:29:43

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: [SOLVED] xmonad: modMask = AltGr?

Yeah, I'd definitely suggest the Windows key(s) if you have one of your keyboard easily accessible, or you could manually pop the key off and swap it with Alt_L if that's in a better position (which in my case Alt_L is easier to press so I swapped it) and remap both of them, that's what I did (also swapping AltGr with Menu).  Anyway, I'll leave the conversation alone now since you seem content, heh.  Take it easy.

Edit:  By the way, I'm not sure but I've read alot of people saying that ISO_Level3_Shift is AltGr, which by default is shown as my Mod5 with `xmodmap -pm' so maybe just set modmask to mod5mask without doing any xmodmap -e "commands" will work, who knows.

Last edited by milomouse (2011-04-06 21:24:13)

Offline

#9 2011-04-07 18:38:41

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] xmonad: modMask = AltGr?

This is crazy. The first thing I did before posting was to try mod1Mask up to mod5Mask. mod5Mask did not work for AltGr but... now it does! Maybe I had some error in my remapping which changed since then, I don't know.

In a nutshell this means:
1) Don't break your AltGr.
2) Put "modMask = mod5Mask" in your xmonad.hs and it should work.

Offline

Board footer

Powered by FluxBB