mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 04:59:29 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			625 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			625 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
uses
 | 
						|
  Gpm;
 | 
						|
 | 
						|
var
 | 
						|
  Conn: TGPMConnect;
 | 
						|
  Quit: Boolean;
 | 
						|
  Event: TGPMEvent;
 | 
						|
 | 
						|
begin
 | 
						|
 | 
						|
  FillChar(Conn, SizeOf(Conn), 0);
 | 
						|
  Conn.EventMask := GPM_MOVE+GPM_DRAG+GPM_DOWN+GPM_UP+GPM_SINGLE+GPM_DOUBLE;
 | 
						|
  Conn.DefaultMask := 0;
 | 
						|
  GPM_Open(Conn, 0);
 | 
						|
  WriteLn('I have opened the mouse... trying to do something tricky...');
 | 
						|
  Quit := False;
 | 
						|
  while not Quit do begin
 | 
						|
    GPM_GetEvent(Event);
 | 
						|
    WriteLn('GetEvent returned... Event.EventType=', Event.EventType);
 | 
						|
    if Event.EventType and GPM_BARE_EVENTS = GPM_DOWN then begin
 | 
						|
      WriteLn('You have pressed a mouse button...');
 | 
						|
      Quit := True;
 | 
						|
    end;
 | 
						|
  end;
 | 
						|
  GPM_Close;
 | 
						|
end. |