xkb: how to map symbol Meta to key Alt

Dirk Wallenstein halsmit at t-online.de
Tue Mar 22 01:18:34 PDT 2011


On Mon, Mar 21, 2011 at 03:41:50PM +0100, Maciej Pilichowski wrote:
> On Monday 21 March 2011 09:51:12 Dirk Wallenstein wrote:
> 
> Thank you for your response. Btw. I am subscriber, no need to CC.
> 
> > Hm, I hope I did understand correctly.  You want to use the Alt key
> > to generate characters and not use any of the desktop functionality
> > tied to it.
> 
> That's right. 
> 
> > If clients interpret Alt and Meta alike, you have to 
> > use another way. 
> 
> It didn't happen in years.
> 
> > Do you have a national layout available that 
> > produces all the chars you want with ISO_Level3_Shift (aka AltGr)? 
> 
> With ISO_Level3_Shift, yes. With AltGr -- no. This is the whole point, 
> to get rid of it.
> 
> > If so you can simply put that modifier onto the Alt key.
> 
> I am exactly asking for this -- how to do it?

The approach in your initial mail was right -- edit the keysym table of
the key and add a modifier_map entry.  The only thing that confuses me
is that you want to have Meta instead of ISO_Level3_Shift there.  Note
that Alt/Meta and AltGr/ISO_Level3_Shift are two different concepts.  If
you start xev and press the key on the right side, what is displayed as
keysym?  If it shows ISO_Level3_Shift please try it with that keysym.

> Three remarks:
> 
> a) I would prefer modify keycode table file (previously xfree86) 
> because this way, all layouts would see alt-key as meta.

You can only exchange keys there, not copy a configuration to another
key.

> b) the reason for my "odd" request is this: being forced to press 
> right Alt-key only to get national characters is so weird for me, 
> that I decided to use both Alt-keys to produce those characters. But 
> Alt (symbol) is hardcoded in X11 to get accelerators. Because of that 
> I have to move that symbol somewhere else. The perfect place is 
> CapsLock.
> So now, I would have Alt-symbol on CapsLock-key, and Meta-symbol on 
> both Alt-keys. So I would have symmetric keyboard, 100% functionality 
> and much more productive layout, I used it for years, and it proved 
> its quality.
> 
> No wonder, I would like to still use it in openSUSE 11.4.

I think what you want does exist as a setxkbmap option.  If you use one
of the major desktops please try to configure it there.  In KDE for
example, I guess it's:
  systemsettings -> hardware -> Input -> Keyboard -> Advanced
        Key to choose third level : Any Alt

> c) I learned how to make a dump of the layout to take a peek how X11 
> sees my layout. Both Alt-key entries were divided for Group1 and 
> Group2. Group1 looks like from X11 original symbol file (pc) and 
> Group2 is coming from me. So it looks like I am only able to add 
> symbols, not redefine keys -- despite they fact I used "replace" 
> keyword in definition.
> But if I could alter keycodes (see (a)), this would solve this 
> problem.
> 
> Kind regards,
> 
> 

-- 
Cheers,
  Dirk



More information about the xorg mailing list