9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] chords for 2-button mice
@ 2000-07-15 10:27 miller
  0 siblings, 0 replies; only message in thread
From: miller @ 2000-07-15 10:27 UTC (permalink / raw)
  To: 9fans

Plan 9 mouse drivers allow a 2-button mouse to impersonate a 3-button mouse
by interpreting shift + right button as middle button.  However, chords
are a problem because shift + left button + right button is still
interpreted as left button + right button.  The following one-line change
to the kernel causes shift + left button + right button on a ps2 mouse
to be interpreted as left button + middle button, which makes acme and
rio much more comfortable on my mouse-challenged thinkpad.

term% diff /sys/src/9/pc/mouse.c mouse.c
62c62
< 	static uchar b[] = {0, 1, 4, 5, 2, 3, 6, 7, 0, 1, 2, 5, 2, 3, 6, 7 };
---
> 	static uchar b[] = {0, 1, 4, 5, 2, 3, 6, 7, 0, 1, 2, 3, 2, 3, 6, 7 };

I believe the following change does the same for serial mice, but I haven't
tested it:

term% diff /sys/src/9/port/devmouse.c devmouse.c
549c549
< 	static uchar b[] = { 0, 4, 1, 5, 0, 2, 1, 5 };
---
> 	static uchar b[] = { 0, 4, 1, 5, 0, 2, 1, 3 };
589c589
< 	static uchar b[] = {0, 4, 2, 6, 1, 5, 3, 7, 0, 2, 2, 6, 1, 5, 3, 7};
---
> 	static uchar b[] = {0, 4, 2, 6, 1, 5, 3, 7, 0, 2, 2, 6, 1, 3, 3, 7};

(Note to Vita Nuova: I think this is applicable to Inferno as well.)

-- Richard Miller


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-07-15 10:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-15 10:27 [9fans] chords for 2-button mice miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).