mouse7.pp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {example for SetMouseShape}
  2. {warning: no error checking is performed on the input}
  3. {the Ascii value you enter is XOR'ed with the Ascii value of the character
  4. on the screen over which you move the cursor. To get a "transparent" cursor,
  5. use the Ascii value 0}
  6. Uses MsMouse, Crt;
  7. Var ascii, fc, bc: Byte;
  8. x,y: Longint;
  9. Begin
  10. If MouseFound Then
  11. Begin
  12. ClrScr;
  13. Writeln('Press any mouse button to quit after you''ve entered a sequence of numbers.');
  14. Writeln;
  15. Writeln('ASCII value of mouse cursor:');
  16. Writeln('Forground color:');
  17. Writeln('Background color:');
  18. ShowMouse;
  19. Repeat
  20. GotoXY(30,3);
  21. ClrEol;
  22. Readln(ascii);
  23. GotoXY(18,4);
  24. ClrEol;
  25. Readln(fc);
  26. GotoXY(19,5);
  27. ClrEol;
  28. Readln(bc);
  29. SetMouseShape(fc, bc, ascii)
  30. Until (GetLastButtonPress(LButton,x,y) <> 0) Or
  31. (GetLastButtonPress(RButton,x,y) <> 0) Or
  32. (GetLastButtonPress(MButton,x,y) <> 0);
  33. HideMouse
  34. End;
  35. End.