Re: confused about XEmacs and xmodmap
Glynn Clements <[email protected]> Mon, 19 Apr 2004 11:43:43 +0100
| Newsgroups | gmane.emacs.xemacs.general |
|---|---|
| Message-ID | <[email protected]> |
Pete Siemsen wrote: > Been using XEmacs happily for years. Recently I upgraded to XEmacs 21.5 > beta17 and XFree86 4.3. Now XEmacs works fine, but emits these warnings > when it starts: > > (1) (key-mapping/warning) > The meanings of the modifier bits Mod1 through Mod5 are determined > by the keysyms used to control those bits. Mod1 does NOT always > mean Meta, although some non-ICCCM-compliant programs assume that. > > (2) (key-mapping/warning) > The semantics of the modifier bits ModShift, ModLock, and ModControl > are predefined. It does not make sense to assign ModControl to any > keysym other than Control_L or Control_R, or to assign any modifier > bits to the "control" keysyms other than ModControl. You can't > turn a "control" key into a "meta" key (or vice versa) by simply > assigning the key a different modifier bit. You must also make that > key generate an appropriate keysym (Control_L, Meta_L, etc). > > (3) (key-mapping/warning) XEmacs: Control_R (0x74) generates Mod4, > which is nonsensical. > > (4) (key-mapping/warning) XEmacs: Control_L (0x73) generates Mod4, > which is nonsensical. > > I have a .Xmodmap file in my home directory. When I renamed the file to > something bogus, restarted X and restarted XEmacs, I didn't get the > warnings, so they are caused by something in my .Xmodmap file. That > narrows it down a bit. > > I set up my .Xmodmap file map to map some of the strange keys on my > keyboard into useful keys. Specifically, my "DvortyBoard" has the usual > right and left "Ctrl" keys, which work as expected - they generate X > keysyms named "Control_R" and "Control_L". Next to each "Ctrl" key is a > key with a funny symbol that looks like a window with 4 panes. I > sometimes hit these keys by accident when I mean to hit a "Ctrl" key, so > I use xmodmap to make these keys be the same as the "Ctrl" keys. I used > the xev program to discover that the keys generate the X keycodes 115 > and 116. My .Xmodmap file contains > > remove Control = Control_L > keycode 115 = Control_L > add Control = Control_L > remove Control = Control_R > keycode 116 = Control_R > add Control = Control_R > > Worked fine in XFree86 4.2.1, where the keycodes were mapped to nothing. > In my new XFree86 4.3.0, they are mapped to the keysyms "Super_R" and > "Super_L", and XEmacs displays the warning paragraphs. The keys still > work as I intend inside and outside of XEmacs - they work like "Ctrl" > keys. > > I confess to being overwhelmed by the complexity of the X modmap > system. Can anyone explain what's wrong, if anything? Your ~/.Xmodmap file also needs: remove mod4 = Control_L remove mod4 = Control_R Essentially, the problem is that your "Windows" keys have both the Control and Mod4 modifiers. A modifier key (Ctrl, Shift, Alt, etc) should never have more than one modifier. If this works with other programs, it's probably because they don't bother to correctly determine which modifier corresponds to "Meta" or "Alt" (but just assume that it's Mod1, which isn't guaranteed), and they don't use any other modifiers. XEmacs understands all modifiers (you can bind commands to Super-<key> and Hyper-<key>), and correctly determines which modifier bits correspond to Meta and Alt (I have both Meta and Alt keys, and XEmacs is about the only program which interprets them correctly; most other programs treat the Alt key as Meta). -- Glynn Clements <[email protected]>