Annotation of src/usr.bin/mg/ttykbd.c, Revision 1.1
1.1 ! deraadt 1: /*
! 2: * Name: MG 2a
! 3: * Termcap keyboard driver using key files
! 4: * Created: 22-Nov-1987 Mic Kaczmarczik (mic@emx.cc.utexas.edu)
! 5: */
! 6:
! 7: #include "def.h"
! 8: #ifdef XKEYS
! 9:
! 10: /*
! 11: * Get keyboard character. Very simple if you use keymaps and keys files.
! 12: * Bob was right -- the old XKEYS code is not the right solution.
! 13: * FKEYS code is not usefull other than to help debug FKEYS code in
! 14: * extend.c.
! 15: */
! 16:
! 17: #ifdef FKEYS
! 18: char *keystrings[] = { NULL } ;
! 19: #endif
! 20:
! 21: /*
! 22: * Turn on function keys using KS, then load a keys file, if available.
! 23: * The keys file is located in the same manner as the startup file is,
! 24: * depending on what startupfile() does on your system.
! 25: */
! 26: extern int ttputc();
! 27:
! 28: ttykeymapinit()
! 29: {
! 30: extern char *KS;
! 31: #ifndef NO_STARTUP
! 32: char *cp, *startupfile();
! 33:
! 34: if (cp = gettermtype()) {
! 35: if (((cp = startupfile(cp)) != NULL)
! 36: && (load(cp) != TRUE))
! 37: ewprintf("Error reading key initialization file");
! 38: }
! 39: #endif
! 40: if (KS && *KS) /* turn on keypad */
! 41: putpad(KS, 1);
! 42: }
! 43:
! 44: /*
! 45: * Clean up the keyboard -- called by tttidy()
! 46: */
! 47: ttykeymaptidy()
! 48: {
! 49: extern char *KE;
! 50:
! 51: if (KE && *KE)
! 52: putpad(KE, 1); /* turn off keypad */
! 53: }
! 54:
! 55: #endif