On Thu, 15 Oct 1998, Jim Burmeister wrote:

> Swing button mnemonics work just fine for me, both in standalone buttons
> and menus.  I've used them in my own code, and I also just checked the
> SwingSet demo and it works OK too.  I did nothing special to set them up;
> pressing Alt+key has always just worked.
> 
> Here's my setup:
> 
>   Red Hat Linux 5.0 w/upgraded glibc libraries
>   Blackdown JDK 1.1.6v4a
>   Swing 1.0.3
>   Metro-X 4.3 X server
> 
> Chances are, the problem is not with the JDK; it's with the way you have your
> X server configured.  Are you able to use the Alt key in other X applications?
> Check your .xinitrc or .xsession script for "xmodmap" commands; if you've used
> xmodmap to reconfigure your keyboard, the Alt keys might be generating keysyms
> other than what the JDK is expecting.  You can use the "xev" program to see
> whay keysyms your Alt keys are generating; here's what the output looks like
> on my system, for the left and right Alt keys respectively.  The keysym on
> the third line is what's important: it should be "Alt_L" and "Alt_R".
> 
> KeyPress event, serial 23, synthetic NO, window 0x4400001,
>     root 0x26, subw 0x0, time 2229881684, (-6,-24), root:(720,883),
>     state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
> 
> KeyPress event, serial 23, synthetic NO, window 0x4400001,
>     root 0x26, subw 0x0, time 2229886534, (-6,-24), root:(720,883),
>     state 0x0, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
> 
> Another thing to try is displaying your program on a different X display, if
> one is available on your network.  If the problem goes away, then you know
> it's something to do with your X server.
> 
> -Jim Burmeister, Metro Link Incorporated <[EMAIL PROTECTED]>
> 

Hi Jim,

Thanks for the response.

The plot thickens... I suppose I should have clarified my position
slightly. I've deployed a organisation-wide Swing application over the
last couple of months, across about two dozen computers. These have
included departmental machines, as well as "at home" boxes, and consist of
various distributions (Redhat 4.2, Redhat 5.0, Redhat 5.1, Debian 2 Hamm
and Debian 2.1 Slink).

Over the course of the few months, some of the users and myself have
upgraded our workstations to ensure that we've had the latest libs, jdk
and swing versions. As noted in my previous post, I've been
personally been through, on 4 different machines, jdks from 1.1.5v5 to
1.1.6v5, swing from 1.0.0 to 1.1 beta 3, 3 different X servers (Xfree86
SVGA, S3 and Suse G200), 3 different window managers (WindowMaker, KDE,
Icewm) and have failed to get mnemonics working on any of them.

It is bothering me that a considerable number of above-average users
(some much more competent than myself), using a variety of distributions,
jdk releases and swing libraries have singularly and independently
also failed to get mnemonics functioning. As mentioned, a large variety
of window managers have been used on these machines (fvwm, fvwm95,
AfterStep, WindowMaker, KDE, icewm, Enlightenment), and the Alt keys have
always worked in our applications (e.g. Netscape, KDE programs, nedit). 

It is more puzzling that many of these systems have been "straight out of
the box" Redhat 5.1 and Debian 2 installs (with all updates applied), they
have not been tweaked or heavily modified in any way. The only major
difference I can discern between the setup of our machines and yours is
that we all use XFree86 servers (SVGA for Matrox Cards, S3, S3 Virge, and
XSuse Matrox) in contrast to your Metrolink server.

I logged onto several machines to follow your advice.

xev on Debian 2.1, XFree86 S3 server, icewm, jdk 1.1.6v5, swing 1.1 beta 1

KeyPress event, serial 24, synthetic NO, window 0x1400001,
    root 0x25, subw 0x0, time 2265715568, (5,487), root:(664,525),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 characters:  ""

KeyRelease event, serial 24, synthetic NO, window 0x1400001,
    root 0x25, subw 0x0, time 2266846990, (-231,526), root:(428,564),
    state 0x8, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
    XLookupString gives 0 characters:  ""

xev on Redhat 5.1, Suse Matrox server, kde 1.0, jdk 1.1.6v4a, swing 1.1
beta 1

KeyRelease event, serial 24, synthetic NO, window 0x2000001,
    root 0x25, subw 0x0, time 2265925595, (-329,376), root:(272,428),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 characters:  ""

KeyRelease event, serial 24, synthetic NO, window 0x1800001,
    root 0x25, subw 0x0, time 2266885649, (397,301), root:(586,511),
    state 0x8, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
    XLookupString gives 0 characters:  ""

xev on Redhat 5.1, XFree S3V server, Afterstep, jdk 1.1.6v4a, swing 1.0.3

KeyRelease event, serial 21, synthetic NO, window 0x3c00001,
    root 0x25, subw 0x0, time 529808619, (73,-6), root:(673,114),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 characters:  ""

KeyRelease event, serial 21, synthetic NO, window 0x3c00001,
    root 0x25, subw 0x0, time 529863179, (50,108), root:(650,228),
    state 0x8, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
    XLookupString gives 0 characters:  ""

Naturally, I've tried running the application (and Swingset) on many
machines, with similar success (or lack of). I've checked a few .xinitrc
and .Xsession files (user-specific and global) and there is no redfinition
of the alt-keys. I'm perplexed as to why the alt keys function perfectly 
in other motif, qt and gtk-based applications.

I know lack of mnemonics is not really a big issue, but my fellow
developers and I were always quite confused by the state of events, given
the large diversity of machines available to us, the lack of any apparent
problems on Linux-specific forums, and the success of our code on Windows
environments.

I would greatly appreciate any other suggestions and advice. Perhaps it's
an XFree86 specific issue? In any case, thank you for the advice you
offered :)

regards,

Eu Hin

iiNet Technologies

Reply via email to