[XForms] Mouse button action on app button
Jens Thoms Toerring
jt at toerring.de
Fri Jan 2 12:16:45 CET 2009
To subscribers of the xforms list
On Thu, Jan 01, 2009 at 11:18:29PM +0100, maddoxik wrote:
> I'm new in xforms and I'm little bit confusing with mouse buttons
> behavior on application button in xforms-1.0.91. Every mouse buttons
> made action on application button. I think it will be better when only
> FL_MBUTTON1 made action on application button.
I also found it not very intuitive that buttons react to all
mouse buttons. On the other hand this behaviour has been the
way it is sinc (I guess) the beginnings of XForms and, when
I tried to change it, I learned that there are a number of
applications that rely on this behaviour, e.g. because they
ascociating a different meaning to a mouse click on a button
when done with mouse button 2 instead of mouse button 1 etc.
Thus completely restricting the reaction of buttons to the
left mouse button breaks existing programs which I think we
should rather avoid.
For that reason I added a new function which you can use
to explicitely set which mouse buttons a button reacts
void fl_set_button_mouse_buttons(FL_OBJECT *obj,
where 'mbuttons' is the bitwise OR of the numbers 1 for the
left mouse button, 2 for the middle, 4 for the right mouse
button, 8 for moving the scroll wheel up "button" and 16 for
scrolling down "button". You can also set this for each
button with fdesign (open the form for the button attri-
butes and select which mouse button to react to in the
"Spec" tab - per default all are allowed, but you can
switch off all except the left mouse button).
(That's what the "!sp->react_to[key - 1]" part of the
testing of which mouse button was clicked on in button.c
is meant for.)
Unfortunately, this function is rather new, so it isn't in
the old documentation for version 0.89. You can only find
it documented in the new version of the documentation I
uploaded a few day ago (and which isn't 100% complete yet).
I hope that this solves the problem for you without going as
far as restricting the reaction to mouse button 1 only, which
would make some other people unhappy.
My best wishes for a happy new year and best regards,
\ Jens Thoms Toerring ________ jt at toerring.de
To unsubscribe, send any message to
xforms-leave at bob.usuhs.mil or see:
List Archive: http://bob.usuhs.mil/pipermail/xforms and
XForms Home: http://savannah.nongnu.org/projects/xforms
More information about the Xforms