~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcdocs/mmouseex/mouse5.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{example for GetLastButtonPress and GetLastButtonRelease}
 
2
 
 
3
Uses MsMouse, Crt;
 
4
 
 
5
Var x, y, times: Longint;
 
6
    c: Char;
 
7
 
 
8
Begin
 
9
  If MouseFound Then
 
10
    Begin
 
11
      ClrScr;
 
12
      ShowMouse;
 
13
      Writeln('Move the mouse and click the buttons (press escape to quit).');
 
14
      Writeln('Press the L-key to see the stats for the left button.');
 
15
      Writeln('Press the R-key to see the stats for the right button.');
 
16
      Writeln('Press the M-key to see the stats for the middle button.');
 
17
      GotoXY(1,19);
 
18
      Write('Since the last call to GetLastButtonPress with this button as parameter, the');
 
19
      GotoXY(1,22);
 
20
      Write('Since the last call to GetLastButtonRelease with this button as parameter, the');
 
21
      Repeat
 
22
        If Keypressed Then
 
23
          Begin
 
24
            c := UpCase(Readkey);
 
25
            Case c Of
 
26
              'L':
 
27
                Begin
 
28
                  GotoXY(1, 20);
 
29
                  ClrEol;
 
30
                  times := GetLastButtonPress(LButton, x, y);
 
31
                  Write('left button has been pressed ',times,
 
32
                          ' times, the last time at (',x,',',y,')');
 
33
                  times := GetLastButtonRelease(LButton, x, y);
 
34
                  GotoXY(1,23);
 
35
                  ClrEol;
 
36
                  Write('left button has been released ',times,
 
37
                          ' times, the last time at (',x,',',y,')')
 
38
                End;
 
39
              'R':
 
40
                Begin
 
41
                  GotoXY(1, 20);
 
42
                  ClrEol;
 
43
                  times := GetLastButtonPress(RButton, x, y);
 
44
                  Writeln('right button has been pressed ',times,
 
45
                          ' times, the last time at (',x,',',y,')');
 
46
                  times := GetLastButtonRelease(RButton, x, y);
 
47
                  GotoXY(1,23);
 
48
                  ClrEol;
 
49
                  Write('right button has been released ',times,
 
50
                          ' times, the last time at (',x,',',y,')')
 
51
                End;
 
52
              'M':
 
53
                Begin
 
54
                  GotoXY(1, 20);
 
55
                  ClrEol;
 
56
                  times := GetLastButtonPress(MButton, x, y);
 
57
                  Writeln('middle button has been pressed ',times,
 
58
                          ' times, the last time at (',x,',',y,')');
 
59
                  times := GetLastButtonRelease(MButton, x, y);
 
60
                  GotoXY(1,23);
 
61
                  ClrEol;
 
62
                  Write('middle button has been released ',times,
 
63
                          ' times, the last time at (',x,',',y,')')
 
64
                End
 
65
            End
 
66
          End;
 
67
      Until (c = #27); {escape}
 
68
      While KeyPressed do ReadKey;
 
69
      GotoXY(1,24);
 
70
      HideMouse
 
71
    End
 
72
End.
 
73