From: DAHMS@ifk20.mach.uni-karlsruhe.de (Heribert Dahms)
Subject: Re: Is it possible to DEFINE KEY in edit/edt AS EXIT?
Organization: University of Karlsruhe, FRG (Dept. of Mechanical Engineering)
Date: Fri, 20 Nov 1992 16:46:19 GMT
X-News-Reader: VMS NEWS 1.20

In <1992Nov20.093822.21259@cs.umb.edu> mzraly@ra.cs.umb.edu writes:

> I am writing a *very* simple data-entry program for use by a few people
> with no experience whatsoever with editing on VMS systems.  I find it
> easiest to use EDIT/EDT for the data entry part, but I would like to
> avoid having to remind the users to type CONTROL-ZexitRETURN: I'd
> much rather be able to have them type, for instance, CONTROL-X or F10
> and have EDT interpret this as CONTROL-ZexitRETURN somehow.
> 
> The "obvious" DEFINE KEY CONTROL X AS 'EX.' does not work, since the
> nokeypad command EX just leaves nokeypad mode for line mode.
> 
> For various reasons, I'd rather *not* use edit/tpu, although obviously
> that would solve the problem.
> 
> On another note, I would like to have the numeric keypad kept in
> numeric mode rather than application mode: I cannot seem to do this in
> any way in EDT.  My current solution is to SPAWN/NOWAIT a subprocess
> that SET TERM/NUMERIC <terminal-name> after waiting a fraction of a
> second, but this is a pretty ugly solution.  Can anyone tell me any
> better solution?
> 
> Thanks,
>   Mike
> 
> -- 
> Mike Zraly		The first duty of a revolutionary is to get away
> mzraly@cs.umb.edu	with it.	-- Abbie Hoffman

Yes, you can,
Heribert

Here is my version of EDTINI.EDT :
! Set-up:
!
! Suppress the bell or buzzer that signals errors
SET QUIET
! Define delimiters for the word entity
SET ENTITY WORD ' 	.,?!;:[]()<>*-+=/\'
! Define delimiters for the sentence entity
SET ENTITY SENTENCE '. ?!'
! Suppress line numbers in line mode
SET NONUMBERS
! Wrap full words to the next line at 75 characters
!SET WRAP 75
SET NOWRAP
!
! Key Definitions:
! 
! Change to the specified buffer
DEFINE KEY GOLD B AS "EXT CHANGE =?'CHANGE TO BUFFER: '."
! Change to the last current line in the previous buffer
DEFINE KEY GOLD C AS "EXT CHANGE LAST."
! Change the case of the current word
DEFINE KEY GOLD D AS "+CHGCW."
! Locate the last current line in the MAIN buffer
DEFINE KEY GOLD G AS "EXT FIND=MAIN.."
! Prompt for a buffer name and then locate the last current line
! in the specified buffer
DEFINE KEY GOLD H AS "EXT FIND=?*'BUFFER:  '.."
! Exit file
DEFINE KEY GOLD E AS "EXT EXIT."
! Fill the text of the current paragraph to the right margin
DEFINE KEY GOLD P AS "FILLPAR."
! Quit file
DEFINE KEY GOLD Q AS "EXT QUIT."
! Shift screen left 1 tab (8 columns)
DEFINE KEY GOLD L AS "SHL."
! Shift screen right 1 tab (8 columns)
DEFINE KEY GOLD R AS "SHR."
! Replace all occurrences of the specified string in the 
! current buffer with the specified string
DEFINE KEY GOLD S AS "EXT S/?*'REPLACE: '/?*'   WITH: '/WHOLE."
! Transpose the two characters to the left of the cursor
DEFINE KEY GOLD T AS "BACK C DC ADV C UNDC."
! Write the current buffer to the specified file
DEFINE KEY GOLD W AS "EXT WRITE ?*'WRITE TO FILE: '."
! Include the specified file at the current line
DEFINE KEY GOLD X AS "EXT INCLUDE ?*'INCLUDE FILE: '."
! Include the specified file at the beginning of 
! the specified buffer
DEFINE KEY GOLD Y AS "EXT INCLUDE ?*'INCLUDE FILE: ' =?*' BUFFER: ';FIND BEGIN."
! F17 inserts opening bracket
DEFINE KEY FUNCTION 31 AS "I{."
! F18 inserts closing bracket
DEFINE KEY FUNCTION 32 AS "I}."
!
! Select editing mode: 
SET MODE CHANGE