From mboxrd@z Thu Jan 1 00:00:00 1970 From: Enache Adrian To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: random moving of cursor arrow Message-ID: <20030726095940.GA2481@ratsnest.hole> References: <012c01c3528e$f861d2a0$b9844051@insultant.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Date: Sat, 26 Jul 2003 12:59:40 +0300 Topicbox-Message-UUID: 04625bb4-eacc-11e9-9e20-41e7f4b1d025 A question about mouse support: Have the new changes to the serial ports & mice code added support for scroll serial mice (aka microsoft intellimice with 5 buttons) and for shift-button3 button2 emulation ? I'm using a rather old 4th edition plan9 (Tue Sep 3 00:36:58 2002), and there I hacked some code in the kernel so it works fine for me now (but no code for pnp identification in aux/mouse.c - that would be simple, though). It looks like this: src/9/port/devmouse.c: /* * microsoft intellimouse 3 buttons + scroll * byte 0 - 1 L R Y7 Y6 X7 X6 * byte 1 - 0 X5 X4 X3 X2 X1 X0 * byte 2 - 0 Y5 Y4 Y3 Y2 Y1 Y0 * byte 3 - 0 0 M % % % % * * %: 0xf => U , 0x1 => D * * L: left * R: right * U: up * D: down */ int m5mouseputc(Queue*, int c) { static uchar msg[3]; static int nb; msg[nb++] = c & 0x7f; if (nb == 4) { schar dx,dy,newbuttons; dx = msg[1] | (msg[0] & 0x3) << 6; dy = msg[2] | (msg[0] & 0xc) << 4; newbuttons = (msg[0] & 0x10) >> (shiftpressed ? 3:2) | (msg[0] & 0x20) >> 5 | ( msg[3] == 0x10 ? 0x02 : msg[3] == 0x0f ? 0x08 : msg[3] == 0x01 ? 0x10 : 0 ); mousetrack(dx, dy, newbuttons, TK2MS(MACHP(0)->ticks)); nb = 0; } return 0; } (I also changed 'shift' in i8042intr() to 'shiftpressed' and made it global, and removed 'mouseshifted' which was never set). Thanks & Regards, Adi