Re: XForms: KeyPress problems

Steve Lamont (spl@szechuan.ucsd.edu)
Thu, 23 Apr 98 05:43:06 PDT

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

> I copied this from an example with MesaGL and Xforms, but I'll try
> your suggestion. Thank you for the notice.

Where is the example? Is it in the XForms demos? It certainly looks
wrong to me.

Here's an excerpt from code I use:

#define CTRL(a) ( a - '@' )

static int key_press_event_handler( FL_OBJECT *obj, Window window,
int window_width, int window_height,
XEvent *xevent, void *user_data )

{

XKeyEvent *xkey_press = ( XKeyEvent *) xevent;
char buffer[80]; /* much overkill */
KeySym keysym;
XComposeStatus compose_status;
int l;

l = XLookupString( xkey_press, buffer, sizeof( buffer ),
&keysym, &compose_status );

if ( l == 1 ) {

[...]

switch ( buffer[0] ) {

case CTRL('C'): {

[...]

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/