1 #include <aros/oldprograms.h>
5 * compile & link with GoodDouble.o
7 * ( or with GoodDouble2.o if you are NOT INTERESTED in MIDDLE
8 * button, but you MUST also #undefine ALL_BUTTONS. FORGET IT! )
11 #include <exec/types.h>
12 #include <intuition/intuition.h>
14 #include "good_double.h" /* macros & functions' prototypes */
19 * they usually put something like that it ROM Kernel manuals...
22 int CXBRK(void) { return(0); }
23 void chkabort(void) { return; }
26 /* something to brighten-up the output... */
27 #define ANSI_WHITE "›2m" /* sometimes it's white, sometimes not... */
28 #define ANSI_NORMAL "›0m"
31 struct IntuitionBase
*IntuitionBase
;
33 int main(int argc
, char **argv
)
37 struct NewWindow TestWindow
= {
38 50, 50, /* left, top */
39 450, 80, /* width, height */
40 0, 1, /* detailpen, blockpen */
41 ( CLOSEWINDOW
| MOUSEBUTTONS
| VANILLAKEY
),
42 ( WINDOWCLOSE
| WINDOWDRAG
| NOCAREREFRESH
| RMBTRAP
),
43 NULL
, /* no custom gadgets */
44 NULL
, /* no custom menu images */
45 (UBYTE
*)"Let's play -- HIT ME ME WITH EVERYTHING YOU GOT!",
46 NULL
, /* no custom screen structure */
47 NULL
, /* no superbitmap */
52 struct Window
*testWnd
;
53 struct IntuiMessage
*msg
;
59 BOOL fDone
= FALSE
; /* the Hungarian naming convention! */
62 * this, as well as CloseLibrary(), wouldn't be needed for DICE
65 (struct IntuitionBase
*)OpenLibrary( "intuition.library", 0L );
67 if ( ! IntuitionBase
)
73 testWnd
= (struct Window
*)OpenWindow( &TestWindow
);
78 WaitPort( testWnd
->UserPort
);
79 while (( msg
= (struct IntuiMessage
*)GetMsg( testWnd
->UserPort
) )) {
86 ReplyMsg( (struct Message
*)msg
);
92 /* ---> */ if ( RightDouble( secs
, micros
) )
93 puts( "Second, quick one... It was "
95 ANSI_NORMAL
"RIGHT!" );
97 puts( "Just a simple RIGHT..." );
100 /* ---> */ if ( MiddleDouble( secs
, micros
) )
101 puts( "Next! It was quick... So it was "
103 ANSI_NORMAL
"MIDDLE!" );
105 puts( "Just a MIDDLE..." );
108 /* ---> */ if ( LeftDouble( secs
, micros
) )
109 puts( "And now a second... "
111 ANSI_NORMAL
"LEFT then!" );
113 puts( "Just a straight LEFT..." );
118 puts( ANSI_WHITE
"Ouch! " ANSI_NORMAL
119 "You wacked me with " ANSI_WHITE
"VANILLA"
120 ANSI_NORMAL
"...!" );
131 while (( msg
= (struct IntuiMessage
*)GetMsg( testWnd
->UserPort
)) )
132 ReplyMsg( (struct Message
*)msg
);
134 CloseWindow( testWnd
);
135 puts( "Well, it " ANSI_WHITE
"WAS fun" ANSI_NORMAL
". Wasn't it?" );
139 CloseLibrary( (struct Library
*)IntuitionBase
);