summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-03-21 01:27:28 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2019-03-21 01:27:28 +0100
commit58668339bcdf71112b08ccc120609dbf7be478dd (patch)
treeec693029be2f46e1896891044a2ab2629b9922c6
parent678be8399090b9eb90f983b1b4105495893f57f1 (diff)
downloadplan9front-58668339bcdf71112b08ccc120609dbf7be478dd.tar.xz
nusb/kb: fix continuous scrollwheel delta not being reported (thanks sam-d)
-rw-r--r--sys/src/cmd/nusb/kb/kb.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/src/cmd/nusb/kb/kb.c b/sys/src/cmd/nusb/kb/kb.c
index a7de79507..ccc8b3058 100644
--- a/sys/src/cmd/nusb/kb/kb.c
+++ b/sys/src/cmd/nusb/kb/kb.c
@@ -761,7 +761,7 @@ readerproc(void* a)
continue;
/* combine all the slots */
- abs = x = y = b = 0;
+ abs = x = y = z = b = 0;
for(i=0; i<p.ns; *l = *s, i++){
s = &p.s[i];
@@ -773,7 +773,7 @@ readerproc(void* a)
*l = *s;
/* convet absolute z to relative */
- z = s->z;
+ z += s->z;
if(s->abs & 4)
z -= l->z;
@@ -783,10 +783,10 @@ readerproc(void* a)
i, s->id, s->b, s->m,
(uint)s->x / 2147483648.0,
(uint)s->y / 2147483648.0,
- z);
+ s->z);
else
fprint(2, "ptr[%d]: id=%x b=%x m=%x x=%d y=%d z=%d\n",
- i, s->id, s->b, s->m, s->x, s->y, z);
+ i, s->id, s->b, s->m, s->x, s->y, s->z);
}
/* map to mouse buttons */
@@ -795,8 +795,6 @@ readerproc(void* a)
b |= 2;
if(s->b & 2)
b |= 4;
- if(z != 0)
- b |= z > 0 ? 8 : 16;
/* X/Y are absolute? */
if((s->abs & 3) == 3){
@@ -814,8 +812,11 @@ readerproc(void* a)
y += s->y;
}
}
+
+ if(z != 0)
+ b |= z > 0 ? 8 : 16;
- if(abs || x != 0 || y != 0 || b != lastb){
+ if(abs || x != 0 || y != 0 || z != 0 || b != lastb){
lastb = b;
if(f->minfd < 0){