Getting FL_ENTER/LEAVE with Mouse down!

Rob Fletcher (
Mon, 21 Apr 1997 14:42:46 +0100 (BST)

To subscribers of the xforms list from Rob Fletcher <> :


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

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

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

#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;
case FL_ENTER:
printf("Note entered %d\n",(int)ob->u_ldata);
retcode = !FL_PREEMPT;
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 |
| Graphics Coordinator | Phone +44 1904 433816 (ddi) |
| Computing Service | Frontdesk +44 1904 433800 (ddi) |
| University of York | Fax +44 1904 433740 |
| UK | DU Moo Rob_F |
| RobCam |

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: