[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Texmacs-dev] AltGr-Key and XFree86-4.3

From: David Allouche
Subject: [Texmacs-dev] AltGr-Key and XFree86-4.3
Date: Tue, 3 Jun 2003 11:39:18 +0200
User-agent: Mutt/1.5.4i

Hey! A user just sent us a tentative fix to the AltGr problem.

Is nyone using a problematic XFree86 willing to try it?

Extra points awarded for the one who can figure out how to actually
does keysym resolution cleanly (hint inside the message).

----- Forwarded message from Peter Jung <address@hidden> -----

From: Peter Jung <address@hidden>
To: address@hidden
Subject: AltGr-Key and XFree86-4.3
X-Spam-Status: No, hits=-5.4 required=5.0
X-Spam-Checker-Version: SpamAssassin 2.55 (

bug description:

The non standard keys which normaly are accessed via the AltGr-key can not
be accessed inside TeXmacs, when running under the new XFree86-4.3.

possible solution:

in TeXmacs the non standard keys are assigned within the function

x_display_rep::look_up_key (XKeyEvent* ev)

the definition of this function can be found in the file
src/Window/X/x_loop.cc . the code starts

  /* decode non standard keys */
  if (ev->state >= 256) {

under XFree86-4.3, if the event-tester xev is used, the key-combination
AltGr+9 (which means "]" on my german keyboard) produces the output

KeyPress event, serial 27, synthetic NO, window 0x5000001,
    root 0x3a, subw 0x5000002, time 24160612, (42,49), root:(1452,69),
    state 0x80, keycode 18 (keysym 0x5d, bracketright), same_screen YES,
    XLookupString gives 1 bytes:  "]"

which tells us, that the state member variable of the structure XKeyEvent
(which is used as the condition to assign non standard keys within
TeXmacs) takes the value 0x80 = 128, which is smaller than 256. thus, this
is my guess, TeXmacs will never assign a non standard character to a non
standard key-press.


it seems to me, that the assignment of the unsigned int state; member
variable of the struct XKeyEvent has changed between XFree86 4.2 and 4.3.
my guess thus can be checked very easily by inspection of xev output under
an older XFree86. (german keyboard! on english keyboards "]" is not a non
standard key.) (i have no such system right now, so i cannot check this

i have browsed the code for a couple of hours, and have only rudimentary
programming capabilities and i am too stupid to compile or to debug
myself, so i could not check directly whether i am right. i also have no
idea, how the best solution should look like. but it seems to me a bad
idea to check XKexEvent.state for this. I think a better solution would be
to let XFree86 itself determine the correct Keysym, like xev (correctly)
does.  (maybe via the function XtGetActionKeysyms?)

(i think all the assumptions concerning the name change from Mode_switch
to ISO_Level3_Shift are irrelevant here, because TeXmacs does not use
this information. It only uses XKeyEvent.state to switch between standard
and non standard keys, as far as i can see.)

i hope i could help a bit,

Peter Jung

----- End forwarded message -----
                                                            -- ddaa

reply via email to

[Prev in Thread] Current Thread [Next in Thread]