shithub: riscv

Download patch

ref: b8136286b6044b81945983a4651fcf9fb70ddad0
parent: fe62caef5f4903426b727898472790c0a4dd694f
author: stanley lieber <[email protected]>
date: Wed Nov 30 17:12:04 EST 2011

kb.c: add curly braces to enable usb mouse nub scrolling

--- a/sys/src/cmd/nusb/kb/kb.c
+++ b/sys/src/cmd/nusb/kb/kb.c
@@ -264,10 +264,12 @@
 			y = buf[2];
 		}
 		b = maptab[buf[0] & 0x7];
-		if(c > 3 && buf[3] == 1)	/* up */
+		if(c > 3 && buf[3] > 0){	/* up */
 			b |= 0x08;
-		if(c > 3 && buf[3] == -1)	/* down */
+		}
+		if(c > 3 && buf[3] < 0){	/* down */
 			b |= 0x10;
+		}
 		if(kbdebug > 1)
 			fprint(2, "%s: m%11d %11d %11d\n", argv0, x, y, b);
 		seprint(mbuf, mbuf+sizeof(mbuf), "m%11d %11d %11d", x, y,b);