home *** CD-ROM | disk | FTP | other *** search
- ************************************************************************
- * Handler.a
- *
- * Handler that grabs all inputevents
- *
- ************************************************************************
- *
- * Required includes...
- *
- INCLUDE "exec/types.i"
- INCLUDE "exec/io.i"
- INCLUDE "devices/inputevent.i"
- *
- ************************************************************************
- *
- * Declarations
- *
- xdef _Grab
- xref _eventbuf
- *
- ************************************************************************
- *
- _Grab: move.l a0,-(sp) ; Save the event list
- move.l a1,-(sp)
- *
- *
- CheckLoop: cmp.b #IECLASS_RAWKEY,ie_Class(a0) ; Check for key
- bne.s NextEvent ; If not, next...
- *
- lea _eventbuf,a1
- move.l a0,(a1) ; Save...
- *
- NextEvent: move.l (a0),d0 ; Get next event
- move.l d0,a0 ; into a0...
- bne.s CheckLoop ; Do some more.
- *
- * All done, just return 0 as the event list... (in d0)
- *
- move.l (sp)+,a1
- move.l (sp)+,d0 ; Get event list back...
- move.l #0,d0
- rts ; return from handler...
-
- END
-