home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
system
/
alock
/
source.lha
/
handler.a
< prev
Wrap
Text File
|
1993-09-02
|
1KB
|
45 lines
************************************************************************
* 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