home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 600-699 / ff631.lha / KeyBang / Source / handler.a next >
Text File  |  1992-04-06  |  1KB  |  62 lines

  1. ;:ts=8
  2.     public    _BabyInputHandler
  3. *
  4. *  BabyInputHandler  by Mike Stark
  5. *  ----------------
  6. *
  7. *  An input handler which effectively shuts down intuition.  This handler
  8. *  checks if the event which it is passed is a keyboard event.  If it is,
  9. *  it sends a copy of the event to the KeyBang program and then sets the
  10. *  message type to NULL so that intuition will ignore it.  It also zeros
  11. *  the qualifier on all events.
  12. *
  13. *  BabyInputHandler is meant to be installed as an input handler.  When it
  14. *  is called, A0 contains the address of the input event to be processed and
  15. *  A1 contains the address of data which is initialized by the program which
  16. *  installed the handler.  In this case, (A1) contains the address of the
  17. *  message port to which the input messages will be copied and 4(A1) contains
  18. *  SysBase, the address of the system library.
  19. *
  20.  
  21. _BabyInputHandler:
  22.     movem.l    .3,-(sp)
  23.     move.l    a0,a4
  24.     move.l    a1,a5
  25.     move.l    a0,a2
  26. .4
  27.     move.l    a2,d0
  28.     beq    .5
  29.     cmp.b    #1,4(a2)
  30.     bne    .6
  31.     move.l    #42,d0
  32.     move.l    #1,d1
  33.     move.l  4(a5),a6
  34.     jsr    -198(a6)
  35.     move.l    d0,a3
  36.     move.l    a3,a0
  37.     add.l    #20,a0
  38.     move.l    a2,a1
  39.     move.l    #4,d0
  40. .7
  41.     move.l    (a1)+,(a0)+
  42.     dbra    d0,.7
  43.     move.w    (a1)+,(a0)+
  44.     move.l  (a5),a0
  45.     move.l    a3,a1
  46.     jsr    -366(a6)
  47.     clr.b    4(a2)
  48. .6
  49.     clr.w    8(a2)
  50.     move.l    (a2),a2
  51.     bra    .4
  52. .5
  53.     move.l    a4,d0
  54. .8
  55.     movem.l    (sp)+,.3
  56.     rts
  57. .2    equ    0
  58. .3    reg    a2/a3/a4/a5
  59.     public    .begin
  60.     dseg
  61.     end
  62.