--- microwindows-0.91-old/src/nanox/srvevent.c  2003-05-19 11:12:16.000000000 +0800
+++ microwindows-0.91-new/src/nanox/srvevent.c  2008-03-21 13:32:21.000000000 +0800
@@ -282,6 +282,15 @@
                        newbuttons, changebuttons, modifiers);
        }

+       /*
+        * Additional, generate a button down event if wheel have been scrolled.
+        */
+       else if (newbuttons & 0xC0) {
+               GsResetScreenSaver();
+               GsDeliverButtonEvent(GR_EVENT_TYPE_BUTTON_DOWN,
+                       newbuttons, newbuttons & 0xC0, modifiers);
+       }
+
        curbuttons = newbuttons;
 }

--- microwindows-0.91-old/src/engine/devmouse.c 2003-06-16 11:33:02.000000000 +0800
+++ microwindows-0.91-new/src/engine/devmouse.c 2008-03-21 11:13:46.000000000 +0800
@@ -279,7 +279,7 @@
         * because some of the filters (like the transform) need to be called
         * several times before we get valid data.
         */
-       if (buttons != newbuttons) {
+       if ((buttons != newbuttons) || (newbuttons & 0xC0)) {
                changed = TRUE;
                buttons = newbuttons;
        }

--- microwindows-0.91-old/src/drivers/mou_ser.c 2003-08-13 00:00:37.000000000 +0800
+++ microwindows-0.91-new/src/drivers/mou_ser.c 2008-03-21 13:51:33.000000000 +0800
@@ -108,7 +108,9 @@
 static int     MOU_GetButtonInfo(void);
 static void    MOU_GetDefaultAccel(int *pscale,int *pthresh);
 static int     MOU_Read(MWCOORD *dx, MWCOORD *dy, MWCOORD *dz, int *bptr);
+#if _MINIX
 static int     MOU_Poll(void);
+#endif
 static int     ParsePC(int);           /* routine to interpret PC mouse */
 static int     ParseMS(int);           /* routine to interpret MS mouse */
 static int     ParsePS2(int);          /* routine to interpret PS/2 mouse */
@@ -172,7 +174,7 @@
        if (mouse_fd < 0) {
                EPRINTF("Error %d opening serial mouse type %s on port %s.\n",
                        errno, type, port);
-               return -1;
+               return -2;
        }

 #if SGTTY
@@ -234,10 +236,12 @@
        xd = 0;
        yd = 0;
        return mouse_fd;
+#if SGTTY
 err:
        close(mouse_fd);
        mouse_fd = 0;
        return -1;
+#endif
 }

 /*
@@ -318,6 +322,10 @@
                                b |= MWBUTTON_R;
                        if(buttons & middle)
                                b |= MWBUTTON_M;
+                       if(buttons & 0x40)
+                               b |= 0x40;
+                       if(buttons & 0x80)
+                               b |= 0x80;
                        *bptr = b;
                        return 1;
                }
@@ -431,7 +439,7 @@
                case IDLE:
                        if (byte & PS2_CTRL_BYTE) {
                                buttons = byte &
-                                       (PS2_LEFT_BUTTON|PS2_RIGHT_BUTTON);
+                                       (PS2_LEFT_BUTTON|PS2_RIGHT_BUTTON|0xC0);
                                state = XSET;
                        }
                        break;
@@ -453,11 +461,13 @@
        return 0;
 }

+#if _MINIX
 static int
 MOU_Poll(void)
 {
        return 1;       /* used by _MINIX only*/
 }
+#endif

 /*  #define TEST 1  */
 #if TEST
--- nxlib-0.45-old/NextEvent.c 2008-03-12 16:07:28.000000000 +0800
+++ nxlib-0.45-new/NextEvent.c 2008-03-21 14:00:14.000000000 +0800
@@ -153,6 +153,10 @@
                                event->xbutton.button = Button2;
                        else if (pev->changebuttons & GR_BUTTON_R)
                                event->xbutton.button = Button3;
+                       else if (pev->changebuttons & 0x80)
+                               event->xbutton.button = Button4;
+                       else if (pev->changebuttons & 0x40)
+                               event->xbutton.button = Button5;
                        if (pev->buttons & GR_BUTTON_L)
                                event->xbutton.state |= Button1Mask;
                        if (pev->buttons & GR_BUTTON_M)
@@ -183,6 +187,10 @@
                                event->xbutton.button = Button2;
                        else if (pev->changebuttons & GR_BUTTON_R)
                                event->xbutton.button = Button3;
+                       else if (pev->changebuttons & 0x80)
+                               event->xbutton.button = Button4;
+                       else if (pev->changebuttons & 0x40)
+                               event->xbutton.button = Button5;
                        if (pev->buttons & GR_BUTTON_L)
                                event->xbutton.state |= Button1Mask;
                        if (pev->buttons & GR_BUTTON_M)

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()