From mboxrd@z Thu Jan 1 00:00:00 1970 From: miller@hamnavoe.demon.co.uk To: 9fans@cse.psu.edu Date: Sat, 15 Jul 2000 11:27:17 +0100 Subject: [9fans] chords for 2-button mice Message-Id: Topicbox-Message-UUID: de813d8c-eac8-11e9-9e20-41e7f4b1d025 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