Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!UMDD.BITNET!BBOURBIN From: BBOURBIN@UMDD.BITNET (Brett S Bourbin) Newsgroups: comp.sys.amiga Subject: Reading the gameport.device Message-ID: <8806151701.AA08881@jade.berkeley.edu> Date: 15 Jun 88 13:11:07 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 36 I want to use the first port on the Amiga to send mouse movements to my program, so I configured it and now I am ready to read the events. Can I do a: move.b #GPD_READEVENT,IO_COMMAND(a2) ; read cmd in io block move.l eventbufbase,a3 ; get the buffer address move.l a3,IO_DATA(a2) ; tell where to store evnt move #ie_SIZEOF,IO_LENGTH(a2) ; set the size and then do a: move.l a2,a1 ; pass io block callsys SendIO ; ASYNC io send Now I have asked for a event to be reported, according to my triggers set, (more on those later). The program I am using this for is a loop which reads the mouse port, if there is a message, processes the mouse movement or triggers, and then updates the grapgics according to results. So I want to be able to READ the gameport each time through the loop. Now, here comes the real question {AT LAST! 8^) }: Can I use the GetMsg() call, since it will return a zero if there is no messages waiting, and if I get a result on the first call to the routine, do more until I get a zero? I want to do this because I only need the latest event. Is this the best way of doing what I want, or should I do a CheckIO() call and if I get a non-zero return then do a GetMsg()? Now about the triggers- I set the mouse to report movements >= 2 in any direction, also for all up and down mouse buttons. Can I set the timeout value in the trigger structure to some value so it will never timeout? I do not need it, and I don't just want to set it to some large value and have it still timeout if let alone for a long time. Thanks for any help you may lend. Brett S Bourbin Internet: brett@PIGPEN.UMD.EDU Instructional Computing Programs -- University of Maryland, College Park