mouse8.pp 652 B

1234567891011121314151617181920212223242526272829
  1. {example for SetMouseAscii}
  2. {warning: no error checking is performed on the input}
  3. Uses MsMouse, Crt;
  4. Var ascii: Byte;
  5. x,y: Longint;
  6. Begin
  7. If MouseFound Then
  8. Begin
  9. ClrScr;
  10. Writeln('Press any mouse button to quit after you''ve entered an Ascii value.');
  11. Writeln;
  12. Writeln('ASCII value of mouse cursor:');
  13. ShowMouse;
  14. Repeat
  15. GotoXY(30,3);
  16. ClrEol;
  17. Readln(ascii);
  18. SetMouseAscii(ascii)
  19. Until (GetLastButtonPress(LButton,x,y) <> 0) Or
  20. (GetLastButtonPress(RButton,x,y) <> 0) Or
  21. (GetLastButtonPress(MButton,x,y) <> 0);
  22. HideMouse
  23. End;
  24. End.