Explorar el Código

+ Corrected example

michael hace 24 años
padre
commit
06e08d9302
Se han modificado 2 ficheros con 6 adiciones y 3 borrados
  1. 5 2
      docs/mouseex/ex6.pp
  2. 1 1
      docs/mouseex/ex7.pp

+ 5 - 2
docs/mouseex/ex6.pp

@@ -15,7 +15,7 @@ begin
       MouseActionUp   : Write('Mouse up.');
       MouseActionMove : Write('Mouse move.');
     end;
-    Writeln('Button state : ');
+    Write('Button state : ');
     If (Buttons and MouseLeftbutton)<>0 then
       Write('Left ');
     If (Buttons and MouseRightbutton)<>0 then
@@ -35,7 +35,10 @@ begin
   Writeln('Play with mouse. Press right mouse button to end.');
   Repeat
     If PollMouseEvent(Event)Then
-      DumpEvent(Event)
+      begin
+      DumpEvent(Event);
+      GetMouseEvent(Event);
+      end
     else
       Write('.');
   Until (Event.Buttons=MouseRightButton) and 

+ 1 - 1
docs/mouseex/ex7.pp

@@ -17,7 +17,7 @@ begin
     If (GetMouseY>20) then
       SetMouseXY(GetMouseX,5);
     GetMouseEvent(Event);
-  Until (Event.Buttons=MouseLeftButton) and
+  Until (Event.Buttons=MouseRightButton) and
         (Event.Action=MouseActionDown);
   DoneMouse;
 end.