plan 9 kernel history: overview | file list | diff list

2001/0404/pc/mouse.c (diff list | history)

2000/1012/sys/src/9/pc/mouse.c:69,742001/0404/sys/src/9/pc/mouse.c:69,80 (short | long | prev | next)
2000/1012    
 * Also on laptops with AccuPoint AND external mouse, the 
 * controller may deliver 3 or 4 bytes according to the type 
 * of the external mouse; code must adapt. 
2001/0404    
 * 
 * On the NEC Versa series (and perhaps others?) we seem to 
 * lose a byte from the packet every once in a while, which 
 * means we lose where we are in the instruction stream. 
 * To resynchronize, if we get a byte more than two seconds 
 * after the previous byte, we assume it's the first in a packet. 
1997/0327    
 */ 
static void 
ps2mouseputc(int c, int shift) 
2000/1012/sys/src/9/pc/mouse.c:76,822001/0404/sys/src/9/pc/mouse.c:82,98
2000/1012    
	static short msg[4]; 
1997/0327    
	static int nb; 
2000/0716    
	static uchar b[] = {0, 1, 4, 5, 2, 3, 6, 7, 0, 1, 2, 3, 2, 3, 6, 7 }; 
2001/0404    
	static ulong lasttick; 
	ulong m; 
1997/0327    
	int buttons, dx, dy; 
2001/0404    
 
	/* 
	 * Resynchronize in stream with timing; see comment above. 
	 */ 
	m = MACHP(0)->ticks; 
	if(TK2SEC(m - lasttick) > 2) 
		nb = 0; 
	lasttick = m; 
1997/0327    
 
	/*  
	 *  check byte 0 for consistency 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)