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

1991/0713/ss/screen.c (diff list | history)

1991/0708/sys/src/9/ss/screen.c:382,4011991/0713/sys/src/9/ss/screen.c:382,396 (short | long | prev | next)
1990/1231    
{ 
	static shift = 0x00; 
	static caps = 0; 
	static repeatc = -1; 
	static long startclick; 
1991/0713    
	static int repeatc; 
1991/0112    
	static int kbdstate, k1, k2; 
1990/1231    
	int tc; 
 
	tc = kbdmap[shift][c&0x7F]; 
/* 
	if(c==0xFFFF && repeatc!=-1 && clicks>startclick+40 && (clicks-startclick)%3==0){ 
		kbdc = repeatc; 
1990/1223    
		return; 
	} 
1990/1231    
*/ 
	if(c==0x7F){	/* all keys up */ 
		repeatc = -1; 
1991/0713    
    norepeat: 
		kbdrepeat(0); 
1990/1231    
		return; 
	} 
	if(tc == 0xFF)	/* shouldn't happen; ignore */ 
1991/0708/sys/src/9/ss/screen.c:403,4451991/0713/sys/src/9/ss/screen.c:398,430
1990/1231    
	if(c & 0x80){	/* key went up */ 
		if(tc == 0xF0){		/* control */ 
			shift &= ~2; 
			repeatc =- 1; 
			return; 
1991/0713    
			goto norepeat; 
1990/1223    
		} 
1990/1231    
		if(tc == 0xF1){	/* shift */ 
			shift &= ~1; 
			repeatc = -1; 
			return; 
1991/0713    
			goto norepeat; 
1990/1231    
		} 
		if(tc == 0xF2){	/* caps */ 
			repeatc = -1; 
			return; 
1991/0713    
			goto norepeat; 
1990/1231    
		} 
		if(tc == repeatc) 
			repeatc = -1; 
		return; 
1991/0713    
		goto norepeat; 
1990/1223    
	} 
1990/1231    
	if(tc == 0xF0){		/* control */ 
		shift |= 2; 
		repeatc = -1; 
		return; 
1991/0713    
		goto norepeat; 
1990/1223    
	} 
1990/1231    
	if(tc==0xF1){	/* shift */ 
		shift |= 1; 
		repeatc = -1; 
		return; 
1991/0713    
		goto norepeat; 
1990/1231    
	} 
	if(tc==0xF2){	/* caps */ 
		caps ^= 1; 
		repeatc =- 1; 
		return; 
1991/0713    
		goto norepeat; 
1990/1231    
	} 
	if(caps && 'a'<=tc && tc<='z') 
		tc |= ' '; 
	repeatc = tc; 
/* 
	startclick = clicks; 
*/ 
1991/0713    
	kbdrepeat(1); 
1991/0112    
	if(tc == 0xB6)	/* Compose */ 
		kbdstate = 1; 
	else{ 


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