XForms: multiline input and canvas problem with keystrokes

Welz (udo@tc.uni-bielefeld.de)
Tue, 07 Apr 1998 09:48:01 +0200

# To subscribers of the xforms list from Welz <udo@tc.uni-bielefeld.de> :

Dear all

My problem with xforms 0.88 and HP-UX tc3 A.09.01 E 9000/735 is:

I have a multiline input and a canvas. If the mouse cursor is outside
the canvas
the multiline input will get all the keystrokes (that's ok). But in the
canvas i am not be
able to send the keys to the input. I have tried all combinations with
all the handlers.
In xforms 0.86? or earlier the method described below has done the job
very well.

Thanks for any suggestion Udo

====================================================================================

#include "forms.h"
#include "test.h"

FD_test *fd_test;

int canvas_handle(FL_OBJECT *obj, Window win, int w, int h, XEvent *xev,
void *data)

{
XComposeStatus c_stat; XKeyEvent *xkey=(XKeyEvent *) xev;
unsigned char key; KeySym keysym;
XLookupString(xkey,(char *) &key,1,&keysym,&c_stat);
fd_test->input->handle(fd_test->input,FL_KEYBOARD,0,0,(int)
keysym,(void *) xev);
return 0;
}

int main(int argc, char *argv[])
{
FL_IOPT iopt;

iopt.sharedColormap=1;
fl_set_defaults(FL_PDSharedMap,&iopt);
fl_initialize(&argc, argv, 0, 0, 0);
fd_test = create_form_test();
fl_add_canvas_handler(fd_test->canvas,KeyRelease,canvas_handle,NULL);
fl_show_form(fd_test->test,FL_PLACE_CENTERFREE,FL_FULLBORDER,"test");
while(1) fl_do_forms();
return 0;
}
_________________________________________________
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/