Don't require keyboard and mouse together. [rsc] --rw-rw-r-- M 140560 glenda sys 12362 Nov 1 07:31 sys/src/9/pc/kbd.c /n/sourcesdump/2005/1101/plan9/sys/src/9/pc/kbd.c:6,13 - /n/sourcesdump/2005/1102/plan9/sys/src/9/pc/kbd.c:6,11 #include "io.h" #include "../port/error.h" - extern void mousetrack(int, int, int, int); - enum { Data= 0x60, /* data port */ /n/sourcesdump/2005/1101/plan9/sys/src/9/pc/kbd.c:170,176 - /n/sourcesdump/2005/1102/plan9/sys/src/9/pc/kbd.c:168,174 }; int mouseshifted; - int kbdbuttons; + void (*kbdmouse)(int); static Lock i8042lock; static uchar ccc; /n/sourcesdump/2005/1101/plan9/sys/src/9/pc/kbd.c:304,309 - /n/sourcesdump/2005/1102/plan9/sys/src/9/pc/kbd.c:302,308 int collecting; int nk; Rune kc[5]; + int buttons; } kbscan; /* /n/sourcesdump/2005/1101/plan9/sys/src/9/pc/kbd.c:402,409 - /n/sourcesdump/2005/1102/plan9/sys/src/9/pc/kbd.c:401,409 case Kmouse|3: case Kmouse|4: case Kmouse|5: - kbdbuttons &= ~(1<<(c-Kmouse-1)); - mousetrack(0, 0, 0, TK2MS(MACHP(0)->ticks)); + kbscan.buttons &= ~(1<<(c-Kmouse-1)); + if(kbdmouse) + kbdmouse(kbscan.buttons); break; } return; /n/sourcesdump/2005/1101/plan9/sys/src/9/pc/kbd.c:473,480 - /n/sourcesdump/2005/1102/plan9/sys/src/9/pc/kbd.c:473,481 case Kmouse|3: case Kmouse|4: case Kmouse|5: - kbdbuttons |= 1<<(c-Kmouse-1); - mousetrack(0, 0, 0, TK2MS(MACHP(0)->ticks)); + kbscan.buttons |= 1<<(c-Kmouse-1); + if(kbdmouse) + kbdmouse(kbscan.buttons); return; } } [rsc] --rw-rw-r-- M 140560 glenda sys 13517 Nov 1 07:31 sys/src/9/port/devmouse.c /n/sourcesdump/2005/1101/plan9/sys/src/9/port/devmouse.c:73,83 - /n/sourcesdump/2005/1102/plan9/sys/src/9/port/devmouse.c:73,85 Cursorinfo cursor; int mouseshifted; int kbdbuttons; + void (*kbdmouse)(int); Cursor curs; void Cursortocursor(Cursor*); int mousechanged(void*); static void mouseclock(void); + static void xkbdmouse(int); enum{ Qdir, /n/sourcesdump/2005/1101/plan9/sys/src/9/port/devmouse.c:115,120 - /n/sourcesdump/2005/1102/plan9/sys/src/9/port/devmouse.c:117,129 } static void + mousefromkbd(int buttons) + { + kbdbuttons = buttons; + mousetrack(0, 0, 0, TK2MS(MACHP(0)->ticks)); + } + + static void mouseinit(void) { if(!conf.monitor) /n/sourcesdump/2005/1101/plan9/sys/src/9/port/devmouse.c:123,128 - /n/sourcesdump/2005/1102/plan9/sys/src/9/port/devmouse.c:132,138 curs = arrow; Cursortocursor(&arrow); cursoron(1); + kbdmouse = mousefromkbd; } static Chan*