diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-12-25 16:52:55 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-12-25 16:52:55 +0100 |
commit | bb4aba830bc467f578a42ac373a82c5d9bd1b610 (patch) | |
tree | 1c76f5adc9d6e8561c71606939077bf4e9bc1ba1 /sys/src/9/port/devmouse.c | |
parent | 3e8764aef1a7d8b9a107b272c3bf83cbf75a01da (diff) |
devmouse: exclude sroll-wheel buttons from differential button handling
preventing wheel buttons 4 and 5 fron getting stuck
with multiple input devices.
Diffstat (limited to 'sys/src/9/port/devmouse.c')
-rw-r--r-- | sys/src/9/port/devmouse.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/src/9/port/devmouse.c b/sys/src/9/port/devmouse.c index f361dcb08..14db40ecf 100644 --- a/sys/src/9/port/devmouse.c +++ b/sys/src/9/port/devmouse.c @@ -374,7 +374,7 @@ mousewrite(Chan *c, void *va, long n, vlong) Cmdbuf *cb; Cmdtab *ct; char buf[64]; - int b, msec; + int b, z, msec; Mousestate *m; p = va; @@ -456,6 +456,11 @@ mousewrite(Chan *c, void *va, long n, vlong) msec = strtol(p, &p, 0); if(msec == 0) msec = TK2MS(MACHP(0)->ticks); + + /* exclude wheel */ + z = b & (8|16); + b ^= z; + m = (Mousestate*)c->aux; m->xy = pt; m->msec = msec; @@ -463,6 +468,11 @@ mousewrite(Chan *c, void *va, long n, vlong) m->buttons ^= b; mouseinbuttons = (m->buttons & b) | (mouseinbuttons & ~b); b = mouse.buttons & ~b; + + /* include wheel */ + b &= ~(8|16); + b ^= z; + if(buf[0] == 'A') absmousetrack(pt.x, pt.y, b, msec); else |