2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <clib/macros.h>
8 #include "intuition_intern.h"
11 #define DEBUG_DOUBLECLICK(x) ;
13 /*****************************************************************************
16 #include <intuition/intuition.h>
17 #include <proto/intuition.h>
19 AROS_LH4(BOOL
, DoubleClick
,
22 AROS_LHA(ULONG
, sSeconds
, D0
),
23 AROS_LHA(ULONG
, sMicros
, D1
),
24 AROS_LHA(ULONG
, cSeconds
, D2
),
25 AROS_LHA(ULONG
, cMicros
, D3
),
28 struct IntuitionBase
*, IntuitionBase
, 17, Intuition
)
31 Check if two times are within the doubleclick intervall.
34 sSeconds, sMicros - Seconds and microseconds of the first event.
35 cSeconds, cMicros - Seconds and microseconds of the second event.
38 TRUE if the times are within the doubleclick intervall, FALSE
53 *****************************************************************************/
59 DEBUG_DOUBLECLICK(dprintf("DoubleClick: t1 %lu/%lu t2 %lu/%lu\n",
60 cSeconds
, cMicros
, sSeconds
, sMicros
));
62 if (ABS(cSeconds
- sSeconds
) <= 4)
66 base
= MIN(cSeconds
, sSeconds
);
68 sMicros
+= 1000000 * (sSeconds
- base
);
69 cMicros
+= 1000000 * (cSeconds
- base
);
71 base
= ABS((LONG
)(sMicros
- cMicros
));
73 ret
= (base
<= GetPrivIBase(IntuitionBase
)->ActivePreferences
->DoubleClick
.tv_micro
+
74 1000000 * GetPrivIBase(IntuitionBase
)->ActivePreferences
->DoubleClick
.tv_secs
);
77 DEBUG_DOUBLECLICK(dprintf("DoubleClick: return %d\n", ret
));