home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Maus_Demo;
- CONST
- buttons : ARRAY[0..7] OF STRING[20] =
- ('keine', 'links', 'rechts', 'links+rechts',
- 'mitte', 'mitte+links', 'mitte+rechts',
- 'mitte+links+rechts');
- VAR
- n, x, y, button : INTEGER;
- textmodus, again : BOOLEAN;
-
- (*$I MAUS.PAS *)
-
- BEGIN
- ClrScr; textmodus := TRUE; n := Init_Mouse;
- IF n > 0 THEN BEGIN
- Set_Mouse(6, 8, TRUE); Set_Mouse_Speed(3);
- Set_Mouse_XY(1, 2, 80, 25, TRUE);
- REPEAT
- ClrScr; again := FALSE;
- IF textmodus THEN BEGIN
- TextMode; Text_Mouse(#1, White, Black);
- END
- ELSE BEGIN
- HiRes; Graphic_Mouse(1, 1, M_Arrow);
- END;
- GotoXY(30, 14);
- Write('Die Maus hat ', n, ' Tasten');
- Show_Mouse;
- GotoXY(75, 25); LowVideo; Write('ENDE');
- GotoXY(3, 10); Write('BEEP AN');
- GotoXY(6, 18); Write('BEEP AUS'); GotoXY(50, 5);
- CASE textmodus OF
- TRUE : Write('in den Grafik-Modus');
- FALSE : Write('in den Text-Modus');
- END;
- NormVideo;
- REPEAT
- GotoXY(1, 1);
- Get_Mouse(x, y, button, textmodus);
- Write(x, ' ', y, ' ',
- buttons[button], ' ');
- Wait_Mouse;
- IF Mouse_in_XY(3, 10, 9, 10, TRUE) THEN BEGIN
- Text_Mouse(#14, Random(White)+Blink, Red);
- Sound(100+Random(500));
- END;
- IF Mouse_in_XY(6, 18, 13, 18, TRUE) THEN BEGIN
- Text_Mouse(Chr(1+Random(2)),Random(White),Cyan);
- NoSound;
- END;
- IF Mouse_in_XY(50, 5, 62, 5, TRUE) THEN BEGIN
- textmodus := NOT textmodus; again := TRUE;
- Set_Mouse(50, 7, TRUE);
- END;
- UNTIL (Button_Pressed AND
- Mouse_in_XY(75, 25, 78, 25, TRUE)) OR again;
- UNTIL NOT again;
- Hide_Mouse;
- END
- ELSE Write('Keine Maus initialisiert');
- TextMode;
- END.