Re: XForms: KeyPress problems

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 24 Apr 98 06:18:04 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> The example was gentile give by Robert S. Mallozzi
> <Robert.Mallozzi@msfc.nasa.gov> and it may not be correct, but it
> works (it actually detects the correct key). I'm sending the program in
> the attachment (below.c) in case you want to take a look. Any way I'll try
> your code.

I stand (partially) corrected.

I did a little research and an experiment. The Keysym returned on an
SGI and a Sun is indeed the ASCII equivalent of the key, _sans_ the
Ctrl modifier, so what Robert gave may work in most cases, although
there are caveats in the Xlib manual about depending upon the actual
values of Keysyms.

If you want to use the Ctrl key modifier, then you can't use the
Keysym value -- it will be wrong. You should use the translation.

Since the Keysym is defined as a server XID I'm not sure I'd want to
always depend upon it being the direct equivalent of the ASCII
character (though I confess I'd be hard pressed to come up with a
sane reason for it not being so).

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/