Re: XForms: Canvas, keystrokes and input object

Steve Lamont (spl@szechuan.ucsd.edu)
Thu, 8 Jan 98 10:40:22 PST

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

> there is a canvas object and an input object object (fl_input..)
> on this form. Now i want to type into the input field but the canvas
> object steals all keystrokes unless mouse cursor is inside the input
> line . The canvas window covers over 90% of the form so mouse focus
> is always on it.( the canvas doesnt receive key events.)
> Is there a way of letting the canvas window pass key strokes on to
> the input object?
> bye. fotang.

Turn off the KeyPressMask bit for the Canvas Window.

XWindowAttributes attrs;
XSetWindowAttributes set_attrs;

[...]

fl_show_form(fd_try->try,FL_PLACE_CENTERFREE,FL_FULLBORDER,"try");
XGetWindowAttributes( fl_get_display(),
FL_ObjWin( fd_try->canvas ),
&attrs );

set_attrs.event_mask = ~KeyPressMask & attrs.your_event_mask;
XChangeWindowAttributes( fl_get_display(),
FL_ObjWin( fd_try->canvas ),
CWEventMask,
&set_attrs );

By default, the KeyPressMask, ExposureMask, and StructureNotifyMask
bits are set in the Canvas object event mask.

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://bloch.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/