[comp.emacs] microemacs/sun function keys

aw@doc.ic.ac.uk (Andrew Weeks) (04/13/88)

Someone asked about getting SUN function keys working under
Microemacs 3.9e. I posted a hack to do this a few months ago.
Here it is again : Remember to set #define VT100 in estruct.h
--------------------------------------------------------------------
*** 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);

DMasterson@cup.portal.com (04/15/88)

In message (255@gould.doc.ic.ac.uk), aw@doc.ic.ac.uk writes:
>Someone asked about getting SUN function keys working under
>Microemacs 3.9e. I posted a hack to do this a few months ago.
>Here it is again : Remember to set #define VT100 in estruct.h
>--------------------------------------------------------------------
>*** 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();
I suggested changing this to allow "M-FNn" keys to work:
			c = getcmd();
but that throws a kinker (I think) into your suggestion below:

>! 			if ( c >= 'A' )
>! 				return(SPEC | c);
>! 			c = c - 48;
>! 			c = (c*10) + get1key() - 48;
>! 			c = (c*10) + get1key() - 176;
>! 			get1key();
>! 			return ( SPEC | c );
How do you reference this key now in a .emacsrc file?  The SUN keys send the
sequence "ESC[###z", what does that get translated to in the above??

>  		}
>  #endif
>  		return(META | c);
>--- 364,370 ----
>  #if	VT100
>  		if (c == '[' || c == 'O') {
>  			c = get1key();
>! 			return(SPEC | c);
>  		}
>  #endif
>  		return(META | c);
>
I'm interested in your suggestion, but I think I missed a couple of important
points.  Since I asked the original question, the best suggestion (well, the
one I'm using) seemed to be to program the .emacsrc file to handle the
function keys.  The problem there is you can't describe a function key.

David Masterson
DMasterson@cup.portal.com