[comp.emacs] uEmacs 3.9 - Function keys on Suns

aw@doc.ic.ac.uk (Andrew Weeks) (12/09/87)

I have implemented, as an extension to the "VT100" option, some extra
code to allow uEmacs to recognise the top, left and right function keys
on Sun 3 consoles.  ( I imagine they will work on Sun 2s as well). 

These keys, except for the cursor keys (R8,R10,R12 & R14), return a
string of the form <ESC>[ followed by 3 digits followed by 'z'.  By
interpreting the digits as an integer, and subtracting 128 to get a
character, all the function keys can be made to simulate 'FN?' keys. 
Which they return depends on how the Sun keyboard is set up (with
setkeys(1)). 

They won't work if you use Sun-windows and have a .ttyswrc file.

Anyway - Here are the diffs:

*** input.c	Mon Nov 30 12:57:21 1987
--- input.c.orig	Mon Nov 30 12:54:37 1987
***************
*** 364,376 ****
  #if	VT100
  		if (c == '[' || c == 'O') {
  			c = get1key();
! 			if ( c >= 'A' )
! 				return(SPEC | c);
! 			c = c - 48;
! 			c = (c*10) + get1key() - 48;
! 			c = (c*10) + get1key() - 176;
! 			get1key();
! 			return ( SPEC | c );
  		}
  #endif
  		return(META | c);
--- 364,370 ----
  #if	VT100
  		if (c == '[' || c == 'O') {
  			c = get1key();
! 			return(SPEC | c);
  		}
  #endif
  		return(META | c);