/* --- Copyright University of Sussex 1993.  All rights reserved. ---------
 >  File:			C.all/lib/ved/term/vedbbckeys.p
 >  Purpose:		Keyboard setup for bbc vt-52 emulator
 >  Author:         J.Handby (see revisions)
 >  Documentation:	HELP *VT52
 >  Related Files:	LIB *VEDBBC *VEDBBCSCREEN
 */
compile_mode :pop11 +strict;

section;

define lconstant vedshell();
	dlocal vedargument = '%';
	ved_obey();
enddefine;

define vedbbckeys();

	/* GOLD function key is assumed to transmit <ESC> P) */

	vedset keys
		charup				= esc A
		charleft			= esc D
		charright			= esc C
		chardown			= esc B
		nextline			= esc cr
		nextline     		= esc ? w           ;;; <F4>
		wordleft			= esc ? u           ;;; <F3>
		wordright			= esc ? M           ;;; <F5>
		charuplots			= '\(143)'          ;;; <shift><up-arrow>
		charleftlots		= '\(140)'          ;;; <shift><left-arrow>
		charrightlots		= '\(141)'          ;;; <shift><right-arrow>
		chardownlots		= '\(142)'          ;;; <shift><down-arrow>
		textleft			= esc esc D         ;;; ESC LEFT arrow
		textright			= esc esc C         ;;; ESC RIGHT arrow
		lineabove			= esc esc A         ;;; ESC UP-arrow
		linebelow			= esc esc B			;;; ESC DOWN-arrow
		screenup			= esc Q
		screenleft			= esc P esc D       ;;; <F0><left-arrow>
		screenright			= esc P esc C       ;;; <F0><right-arrow>
		screendown			= esc ? t           ;;; <F2>
		topfile				= '\(129)'          ;;; <shift><F1>
		endfile				= '\(130)'          ;;; <shift><F2>
		wordleftdelete		= '\(131)'          ;;; <shift><F3>
		wordrightdelete		= '\(150)'          ;;; <shift><F5>
		clearhead			= esc P esc ? u     ;;; - <F0><F3>
		cleartail        	= esc P esc ? M     ;;; - <F0><F5>
		linedelete       	= '\(132)'          ;;; <shift><F4>
		ident enterkey		= esc ? n           ;;; <F9>
		ident redokey		= esc ? q           ;;; <shift><F9>
		popkey				= esc P del
		pushkey				= esc P esc ? s     ;;; - <F0><COPY>
		ENTER files			= '\(128)'			;;; <shift><F0>
		"ENTER cut"			= esc del
		ENTER t				= esc R
		ENTER xup			= esc esc Q         ;;; ESC F1
		"ENTER cut"			= esc esc R         ;;; ESC <shift> F7
		ENTER xdn			= esc esc ? t       ;;; <ESC><F2>
		"ENTER yankw"		= esc esc ? u       ;;; <ESC><F3>
		"ENTER yankl"		= esc esc ? w       ;;; <ESC><F4>
		"ENTER yankw"		= esc esc ? M       ;;; <ESC><F5>
		"ENTER y"			= esc esc ? x       ;;; <ESC><F6>
		ENTER m				= esc esc ? r       ;;; <ESC><F7>
		ENTER mcp			= esc esc ? p       ;;; <ESC><F8>
		"ENTER splice"		= esc esc ? s       ;;; <ESC><COPY>
		ENTER copy			= esc ? x           ;;; <F6>
		ENTER m				= esc ? r           ;;; <F7>
		ENTER d				= esc ? v           ;;; <shift><F6>
		ENTER pop			= esc P esc P       ;;; <F0><F0>
		ENTER rb			= esc P esc ? t     ;;; - <F0><F2>
		ENTER da			= esc P esc ? x     ;;; - <F0><F6>
		ENTER lcp			= esc P esc ? p		;;; - <F0><F8>
		"ENTER yankc"  		= esc P esc ? n     ;;; - <F0><F9>
		marklo				= esc ? p           ;;; <F8>
		markhi				= esc ? y           ;;; <shift><F8>
		statusswitch		= esc esc ? n       ;;; <ESC><F9>
		setwindow			= '\(139)'          ;;; <shift><COPY>
		refresh				= esc ? s           ;;; <COPY>
		exchangeposition	= esc P cr
		swapfiles			= esc P esc Q		;;; <F0><F1>
		charup <> textleft	= esc P esc A		;;; <F0><up-arrow>
		nextline <> textleft= esc P esc B		;;; <F0><down-arrow>
		shell				= esc esc P
	endvedset

enddefine;

endsection;


/* --- Revision History ---------------------------------------------------
--- John Gibson, Jan  5 1993
		Replaced quoted words with idents for some core variable ops
--- Jason Handby, Jul 12 1988 - split into two files and changed to use
	vedset notation, changed name to vedbbckeys, moved preamble to new
	vedbbc.p file.
--- Poplog System, Nov 29 1988 - fixed <ESC> F0 for Unix (cf ALPHA 8)
--- Ben Rubinstein, Oct 12 1986  - vedenter, vedredo indirected through ..key
*/
