9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Enache Adrian <enache@rdslink.ro>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Re: random moving of cursor arrow
Date: Sat, 26 Jul 2003 12:59:40 +0300	[thread overview]
Message-ID: <20030726095940.GA2481@ratsnest.hole> (raw)
In-Reply-To: <c63b4460a0a3df15255d0f743486c75e@plan9.bell-labs.com>

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


  parent reply	other threads:[~2003-07-26  9:59 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-25  8:52 [9fans] " sasa
2003-07-25  8:43 ` Lucio De Re
2003-07-26 15:59   ` David Presotto
2003-07-26 16:40     ` Dan Cross
2003-07-26 16:44       ` David Presotto
2003-07-26 17:10         ` Skip Tavakkolian
2003-07-26 17:14         ` Dan Cross
2003-07-26 17:19           ` rob pike, esq.
2003-07-26 17:23           ` boyd, rounin
2003-07-28  9:00         ` matt
2003-07-26 17:10     ` boyd, rounin
2003-07-28  5:48     ` Lucio De Re
2003-07-25  9:02 ` boyd, rounin
2003-07-25  9:01   ` Lucio De Re
2003-07-25  9:08 ` Fco.J.Ballesteros
2003-07-25 14:08   ` Scott Schwartz
2003-07-25 14:35     ` UART device driver (Was: [9fans] random moving of cursor arrow) Lucio De Re
2003-07-25 14:56       ` boyd, rounin
2003-07-26  5:50       ` jmk
2003-07-28  5:36         ` Lucio De Re
2003-07-25  9:17 ` [9fans] Re: random moving of cursor arrow sasa
2003-07-25  9:24   ` sasa
2003-07-25  9:25     ` sasa
2003-07-25  9:27       ` boyd, rounin
2003-07-26  2:22         ` David Presotto
2003-07-26  8:37           ` C H Forsyth
2003-07-26  8:51             ` boyd, rounin
2003-07-28  8:47               ` Douglas A. Gwyn
2003-07-26 15:37             ` David Presotto
2003-07-26  9:59           ` Enache Adrian [this message]
2003-08-07 13:52             ` David Presotto
2003-07-26 19:01           ` Richard Miller
2003-07-28  5:26           ` Lucio De Re
2003-07-28  6:18             ` Lucio De Re
2003-07-29  3:11             ` David Presotto
2003-07-25 10:27       ` sasa
2003-08-07 14:35 David Presotto
2003-08-08 21:14 ` Enache Adrian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030726095940.GA2481@ratsnest.hole \
    --to=enache@rdslink.ro \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).