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

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