tbs0020.pp 713 B

1234567891011121314151617181920212223242526272829303132
  1. { this program need GPM !! }
  2. {$ifdef linux}
  3. uses
  4. Gpm;
  5. var
  6. Conn: TGPMConnect;
  7. Quit: Boolean;
  8. Event: TGPMEvent;
  9. begin
  10. FillChar(Conn, SizeOf(Conn), 0);
  11. Conn.EventMask := GPM_MOVE+GPM_DRAG+GPM_DOWN+GPM_UP+GPM_SINGLE+GPM_DOUBLE;
  12. Conn.DefaultMask := 0;
  13. GPM_Open(Conn, 0);
  14. WriteLn('I have opened the mouse... trying to do something tricky...');
  15. Quit := False;
  16. while not Quit do begin
  17. GPM_GetEvent(Event);
  18. WriteLn('GetEvent returned... Event.EventType=', Event.EventType);
  19. if Event.EventType and GPM_BARE_EVENTS = GPM_DOWN then begin
  20. WriteLn('You have pressed a mouse button...');
  21. Quit := True;
  22. end;
  23. end;
  24. GPM_Close;
  25. {$else def linux}
  26. begin
  27. {$endif def linux}
  28. end.