home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d0xx / d049 / plot.lha / Plot / mouse2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-01-11  |  630 b   |  34 lines

  1. /* mouse2.c */
  2. #define MAXX 639
  3. #define MINX 0
  4. #define MAXY 399
  5. #define MINY 0
  6.  
  7. SHORT mx,my;
  8.  
  9. mouse()
  10. {
  11.    char button;
  12.    struct IntuiMessage *BdMsg;
  13.    APTR Maddress;
  14.  
  15.    button=1;
  16.    while(button){
  17.       while (BdMsg = (struct IntuiMessage *)GetMsg(w->UserPort)){
  18.          Maddress = BdMsg->IAddress;
  19.          mx = BdMsg->MouseX;
  20.          my = BdMsg->MouseY;
  21.          if (mx>MAXX)
  22.             mx=MAXX;
  23.          if (mx<MINX)
  24.             mx=MINX;
  25.          if (my>MAXY)
  26.             my=MAXY;
  27.          if (my<MINY)
  28.             my=MINY;
  29.          button=(*((unsigned char *)0xbfe001)) & 0x40;
  30.          ReplyMsg(BdMsg);
  31.       }
  32.    }
  33. }
  34.