mailing-list for TeXmacs Users

Text archives Help


Re: Modifier mapping suddenly broken?


Chronological Thread 
  • From: Lionel Elie Mamane <address@hidden>
  • To: Joris van der Hoeven <address@hidden>
  • Cc: Norbert Nemec <address@hidden>, address@hidden, address@hidden
  • Subject: Re: Modifier mapping suddenly broken?
  • Date: Tue, 30 Nov 2004 17:32:54 +0100

(Please do not CC texmacs-users on replies. Moving this discussion to
address@hidden.)

On Tue, Nov 30, 2004 at 03:15:33PM +0100, Joris van der Hoeven wrote:

>> How does it determine which numbered modifier is which named
>> modifier, then? Can you please give me a headstart and point me to
>> the right file? Thanks.

> The current keyboard handling is done in
>
> src/Window/X/x_init.cpp
> src/Window/X/x_loop.cpp
>
> and especially in the following routine:
>
> string
> x_display_rep::look_up_key (XKeyEvent* ev)

OK, I added "debugging printf"s there, and the problem is not what you
(we) thought:

> Apparently, when you press the Windows key, then the state becomes 72,
> with the bugged version of X.

(72 = 0x48)

No, the state is 0x40 (with eventually shift and numlock added, so
bits 0x10 and 0x01).

Could the other people running into this problem please check? Run
"xev", give its window the focus, press "Meta-s" and "Alt-s" (with
whatever key should be Alt or Meta in your setup, then the s key,
release the s key and then the modifier key). Also send the output of
xmodmap, please. For each of Meta-s and Alt-s, xev will output
something along the lines of:

KeyPress event, serial 28, synthetic NO, window 0x3c00001,
root 0x40, subw 0x0, time 520690940, (175,127), root:(204,245),
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes: ""

KeyPress event, serial 28, synthetic NO, window 0x3c00001,
root 0x40, subw 0x0, time 520691327, (175,127), root:(204,245),
state 0x8, keycode 39 (keysym 0x73, s), same_screen YES,
XLookupString gives 1 bytes: "s"

KeyRelease event, serial 28, synthetic NO, window 0x3c00001,
root 0x40, subw 0x0, time 520691441, (175,127), root:(204,245),
state 0x8, keycode 39 (keysym 0x73, s), same_screen YES,
XLookupString gives 1 bytes: "s"

KeyRelease event, serial 28, synthetic NO, window 0x3c00001,
root 0x40, subw 0x0, time 520691488, (175,127), root:(204,245),
state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes: ""

We are interested in the second one:

KeyPress event, serial 28, synthetic NO, window 0x3c00001,
root 0x40, subw 0x0, time 520691327, (175,127), root:(204,245),
state 0x8, keycode 39 (keysym 0x73, s), same_screen YES,
XLookupString gives 1 bytes: "s"

and particularly in the number after "state" on the third line.

> // cout << "key press: " << s << LF;

I uncommented that line and added a "cerr << ev->state".

Now, the funny thing is that it says

Keypress ev->state: 0x41
key press: Mod4-!

(I need to press shift to reach "1", hence the bit of weight 1.)

but it doesn't insert a label. Now, if I run

xmodmap -e 'remove mod4 = Super_L' && xmodmap -e 'remove mod4 = Hyper_L'

and restart TeXmacs, then look_up_key says the same thing, but now it
does indeed create a label. If I don't restart TeXmacs, nada. So:

1) The problem is somewhere else

2) *Something* is happening at initialisation time that makes it work
or not work, possibly hidden in a library call. Something that
looks the hell like "looking what keysym generates what modifier"
or "read the xmodmap".

3) That same thing should happen when getting a "MappingNotify"
event, at least for request MappingKeyboard and MappingModifier.


I'll try to dig deeper if I get the time later (have to leave *now*).

--
Lionel



Archive powered by MHonArc 2.6.19.

Top of page