detecting double clicks with evnt_multi().. HOW?!

detecting double clicks with evnt_multi().. HOW?!

Post by To » Fri, 01 Mar 2002 18:21:13


Hi there,

I was wondering if anyone could explain how double clicks are detected
using evnt_multi(). Given the following code fragment:

/* wait for either mouse button event or message*/
event= evnt_multi(MU_MESAG|MU_BUTTON,2,1,1,0,0,0,0,0,0,0,
               0,0,0,&messbuf,0,0,&mousex,&mousey,&mstate,&dummy,&key,&dummy);

         if (event & MU_BUTTON)/*it was a mouse button event*/

         /*what other parameters from evnt_multi do I need to examing
to determine if the button event was a click or a double click?Is it
somehow returned in "event"? Or doesn't it work like that? ...*/

cheers!
T

 
 
 

detecting double clicks with evnt_multi().. HOW?!

Post by Erik Ha » Fri, 01 Mar 2002 18:10:58




Quote:> Hi there,

> I was wondering if anyone could explain how double clicks are detected
> using evnt_multi(). Given the following code fragment:

> /* wait for either mouse button event or message*/
> event= evnt_multi(MU_MESAG|MU_BUTTON,2,1,1,0,0,0,0,0,0,0,
>                0,0,0,&messbuf,0,0,&mousex,&mousey,&mstate,&dummy,&key,&dummy);

>          if (event & MU_BUTTON)/*it was a mouse button event*/

>          /*what other parameters from evnt_multi do I need to examing
> to determine if the button event was a click or a double click?Is it
> somehow returned in "event"? Or doesn't it work like that? ...*/

You get the clicks in one of your dummy variables.

Do some thing like this:
event= evnt_multi(MU_MESAG|MU_BUTTON,2,1,1,0,0,0,0,0,0,0,
                0,0,0,&messbuf,0,0,&mousex,&mousey,&mstate,&dummy,&key,&mclicks);

then you have the number of clicks in mclicks.

/Erik

 
 
 

detecting double clicks with evnt_multi().. HOW?!

Post by To » Sat, 02 Mar 2002 19:08:57


Tack s? mycket Eric! My lattice C manuals don't make this very clear at all..
 
 
 

1. Double click & evnt_multi

OK, I got some really good responses about using evnt_button(2, 1, 1, ....

to get a single or a double click.  I tried it out and it works fine.

Now I want to use it within evnt_multi, but I can not seem to be able to
get evnt_mult to give me an indication of weither a single click or a
double click occured.  In my program, I am doing the following:

int selection;

selection = evnt_multu((MU_KEYBD|MU_MESAG|MU_BUTTON), 2,1,1,.....

then I'll display the value of selection. No matter what I do, if I
single click or I double click I get a value of 2 back.

2. network api?

3. Double click when you only clicked once?

4. I don't understand object-oriented programming

5. Double Click when you only clicked once?

6. GNKSA evaluation of ProNews/2 1.0 (OS/2)

7. Single & Double mouse click

8. Anyone successfully used an HP SureStore CD Writer on an Indy ??

9. How can i detect if my Floppy drive is sigle side or double side density

10. Help for Data Diet/Double Click address???

11. TOS 2.06 mouse click doubling

12. Oxyd (was Re: Good Bye Atari (was Re: Good Bye Double Click))

13. Double Click & Internet