xkb: how to map symbol Meta to key Alt

Dirk Wallenstein halsmit at t-online.de
Mon Mar 21 01:51:12 PDT 2011


On Sat, Mar 19, 2011 at 10:46:37PM +0100, Maciej Pilichowski wrote:
> Hello,
> 
>   How to map symbol Meta to key Alt?
> 
> My previous mappings:
> ---------------------
> 
> In opensuse 11.1 I simply edited xfree86 keycodes files, and put for 
> keycodes AltL/AltR scancodes MetaL/MetaR. It worked without any 
> problems with X11.
> 
> Now:
> ----
> 
> I have opensuse 11.4 and editing xfree86 simply does not work (it is 
> completely strange for me, because this file is mentioned in the 
> config files). I put the same table as for 11.1 and Alt was still 
> Alt.
> 
> So I tried to edit symbols file, but no matter what I try, no success. 
> In all cases, xev reports (when pressing Alt) that Meta key was 
> pressed, however X11 still recognizes Alt as Alt -- for example when 
> running Firefox, I press Alt+F and File menu opens, or I press 
> Alt+Tab, and I get windows list.
>   Since I have my entire layout defined for national characters as 
> Meta+key, I can also check if I get national characters (óąłäö, 
> etc.) -- I don't get them.

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.  If clients interpret Alt and Meta alike, you have to use another
way.  Do you have a national layout available that produces all the chars
you want with ISO_Level3_Shift (aka AltGr)?  If so you can simply put that
modifier onto the Alt key.

> 
>   My tries:
> key <LALT> { [ Meta_L ] }; // (*)
> modifier_map Mod3 { <LALT>, <RALT> };
> 
> or
> 
> key <LALT> { [ Meta_L, Meta_L ] };
> modifier_map Mod3 { <LALT>, <RALT> };
> 
> or
> 
> key <LALT> { type[Group1] = "ONE_LEVEL",
>               symbols[Group1] = [ Meta_L ] };
> modifier_map Mod3 { <LALT>, <RALT> };
> 
> 
> I also tried to add "replace" before "key", over and over same results 
> (as you can see, I am/was pretty despair ;-) ).
> 
>   So how to do it with xkb? I could do it with xmodmap, but I prefer 
> xkb -- after switching layout xmodmap is killed.
> 
>   Thank you in advance for help.
> 
> Kind regards,
> 
> (*) the entries are doubled, for right Meta/Alt.

-- 
Cheers,
  Dirk



More information about the xorg mailing list