Re: XForms: Shortcuts for forms

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 4 Nov 97 06:17:53 PST

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

> ... Is it possible to attach a keyboard shortcut
> to a FORM (rather than a specific object) such that pressing that
> particular key combination anywhere within the form will activate
> the specified callback. ...

Register a raw callback with fl_register_raw_callback().

Look at the manual appendix "Dirty Tricks".

Here's a bit of code to process function keys:

int function_key_handler( FL_FORM *form, void *xev )

{

if ( ( ( XEvent *) xev )->type == KeyPress )
switch ( XKeycodeToKeysym( fl_get_display(),
( ( XKeyPressedEvent *) xev )->keycode,
0 ) ) {
case XK_F9: {

do_key_F9();
break;

}
case XK_F10: {

do_key_F10();
break;

}

}
return 0;

}

[...]
fl_register_raw_callback( fd_try->try,
KeyPressMask,
function_key_handler );
[...]

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/