Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!sri-unix!ctnews!pyramid!weitek!sci!phil
From: phil@sci.UUCP (Phil Kaufman)
Newsgroups: comp.emacs
Subject: Re: MicroEmacs 3.9e VT100 Key Mapping?
Message-ID: <11695@sci.UUCP>
Date: Wed, 2-Dec-87 11:41:03 EST
Article-I.D.: sci.11695
Posted: Wed Dec  2 11:41:03 1987
Date-Received: Mon, 7-Dec-87 06:19:45 EST
References: <1280@ncsuvx.ncsu.edu>
Organization: Silicon Compilers Systems Corp. San Jose, Ca
Lines: 84
Summary: VT100 Keys Macro

In article <1280@ncsuvx.ncsu.edu>, sam@ncsuvx.ncsu.edu (Mr. Sam Moore) writes:
> 
> 
> I have MicroEmacs version 3.9e running on a MicroVax(Ultrix) and on a
> VAX(VMS). On both I want to use the function keys and cursor keys. I 
> compiled in the VT100 define. And I tried to map some keys in the
> autoload script file. I was unsuccessful. Does anyone know how to do
> this? Does anyone have any script files other than those in the distribution?
> If so, I would like to see them.


See the command file at the end of this message. It handles the setup
for applications keypad mode and function and cursor key bindings. (If you
do not know the codes for each key you want to add, just do 'describe-
key' after running this macro.

> 
> Also, the VT100 define caused a compiler error in the input.c file in the
> function getcmd(). Unless I have compiled with the wrong options, it seems
> that there is a missing brace, {. If this is old news and there are fixes
> out there somewhere, please let me know. 
> 

Yes, there is a missing left brace. This bug was previously reported. Just
add it as you suggest and all is fine.


HERE IS ANSIIKEYS.CMD


;	SETUP COMMAND FILE FOR ANSII STYLE KEYBOARDS

;	ARROW KEY BINDINGS WORK ON UNMODIFIED MICROEMACS 3.9

;	USE OF FUNCTION KEYS AND APPLICATIONS MODE KEYPAD FUNCTION KEYS
;       WORKS ON UNMODIFIED 3.9e BUT ORIGINAL 3.9 RELEASE
;	REQUIRES A ONE LINE CHANGE TO input.c TO ADD O (that is upper
;	case Oh) TO THE FN KEY SCAN ALONG WITH [.

set	$discmd	0
;       BIND ANSI ARROW KEYS 
bind-to-key next-line FNB
bind-to-key previous-line FNA
bind-to-key backward-character FND
bind-to-key forward-character FNC

;       ENABLE APPLICATIONS KEYPAD MODE ON ENTRY
;       That's "ESC =" in the following write-message
write-message   "="

;       RESTORE NUMERIC KEYPAD ON EXIT
	That's "ESC >" in the following write-messages
bind-to-key execute-macro-39	M-Z
39	store-macro
	write-message   ">"
	quick-exit
!endm
bind-to-key execute-macro-38    ^X^C
38	store-macro
	write-message   ">"
	exit-emacs
!endm
bind-to-key execute-macro-37    ^X!
37	store-macro
	write-message   ">"
	shell-command
!endm


;	SOME PERSONAL PREFERENCE THINGS: 

;	BIND THE BS KEY TO DELETE IN PLACE (DEL deletes previous character)
bind-to-key delete-next-character ^H

;	US UNIX FOLK LIKE ^Z TO DO "BACKGROUND"
bind-to-key suspend-emacs	^Z

;	SOME DEFAULT USE OF PF KEYS
bind-to-key beginning-of-file   FNP	;PF1
bind-to-key previous-page	FNQ	;PF2
bind-to-key next-page		FNR	;PF3
bind-to-key end-of-file		FNS	;PF4

set	$discmd	1