Getting FL_ENTER/LEAVE with Mouse down!

Rob Fletcher (rpf1@york.ac.uk)
Mon, 21 Apr 1997 14:42:46 +0100 (BST)

To subscribers of the xforms list from Rob Fletcher <rpf1@york.ac.uk> :

Hi,

How do I go about getting FL_ENTER and FL_LEAVE events on objects
*with* the mouse button pressed or not.

Basically I want to detect any ENTER/LEAVE on any number
of objects (boxes with a pre_handler installed), but at the same
time detect when a MB is held down and the mouse moved ovber other
items.

BTW: it's a piano keyboard and I want to be able to press a key and
then move the mouse over others and have them activated with the
FL_ENTER event.

I find that in a pre-handler I can detect the events, but once a
FL_PUSH is detected, I can no longer detect FL_ENTER. I set FL_PREEMPT
on FL_PUSH, coz I do not want a redraw as it will foul up the keyoard
rendition!

The code below is the pre-emptive handler, with RELEASE and LEAVE
removed.

#include "forms.h"
#include "keyboard.h"

/* callbacks for form keyboard */

int kb(FL_OBJECT *ob,int event, FL_Coord mx,
FL_Coord my, int key, void *raw_event)
{
int retcode;

switch (event)
{
case FL_PUSH:
printf("Note pushed %d\n",(int)ob->u_ldata);
retcode = FL_PREEMPT;
break;
case FL_ENTER:
printf("Note entered %d\n",(int)ob->u_ldata);
retcode = !FL_PREEMPT;
break;
}
return retcode;
}

Any clues? I really want to do this with "standard" XFORMS calls, and do
not want to get into raw X (it's for a course!).8q

Regards, Rob
+===========================+=======================================+
| Dr R P Fletcher (Rob) | Email R.Fletcher@york.ac.uk |
| Graphics Coordinator | Phone +44 1904 433816 (ddi) |
| Computing Service | Frontdesk +44 1904 433800 (ddi) |
| University of York | Fax +44 1904 433740 |
| YORK YO1 5DD | URL http://www.york.ac.uk/~rpf1/|
| UK | DU Moo Rob_F |
| RobCam http://www.york.ac.uk/~rpf1/robcam.html |
+===================================================================+

_________________________________________________
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/xforms-archive/