[BACK]Return to ttykbd.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

File: [local] / src / usr.bin / mg / ttykbd.c (download)

Revision 1.1, Fri Feb 25 19:08:52 2000 UTC (24 years, 3 months ago) by deraadt
Branch: MAIN

initial import of mg2a

/*
 * Name:	MG 2a
 *		Termcap keyboard driver using key files
 * Created:	22-Nov-1987 Mic Kaczmarczik (mic@emx.cc.utexas.edu)
 */

#include	"def.h"
#ifdef	XKEYS

/*
 * Get keyboard character.  Very simple if you use keymaps and keys files.
 * Bob was right -- the old XKEYS code is not the right solution.
 * FKEYS code is not usefull other than to help debug FKEYS code in
 * extend.c.
 */

#ifdef FKEYS
char	*keystrings[] = { NULL } ;
#endif

/*
 * Turn on function keys using KS, then load a keys file, if available.
 * The keys file is located in the same manner as the startup file is,
 * depending on what startupfile() does on your system.
 */
extern	int	ttputc();

ttykeymapinit()
{
	extern	char *KS;
#ifndef	NO_STARTUP
	char *cp, *startupfile();

	if (cp = gettermtype()) {
		if (((cp = startupfile(cp)) != NULL)
			&& (load(cp) != TRUE))
			ewprintf("Error reading key initialization file");
	}
#endif
	if (KS && *KS)			/* turn on keypad	*/
		putpad(KS, 1);
}

/*
 * Clean up the keyboard -- called by tttidy()
 */
ttykeymaptidy()
{
	extern	char *KE;

	if (KE && *KE)
		putpad(KE, 1);	/* turn off keypad		*/
}

#endif