File: ttykbd.c

package info (click to toggle)
ng 1.5~beta1-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,140 kB
  • sloc: ansic: 43,437; asm: 3,150; sh: 2,539; cpp: 1,234; makefile: 630
file content (87 lines) | stat: -rw-r--r-- 1,664 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* $Id: ttykbd.c,v 1.1 2000/06/27 01:48:02 amura Exp $ */
/*
 * Name:	MG 2a
 *		Termcap keyboard driver using key files
 * Created:	22-Nov-1987 Mic Kaczmarczik (mic@emx.cc.utexas.edu)
 */

/*
 * $Log: ttykbd.c,v $
 * Revision 1.1  2000/06/27 01:48:02  amura
 * Initial revision
 *
 */

#include	"config.h"	/* 90.12.20  by S.Yoshida */
#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();

#ifdef	ADDOPT
ttykeymapinit(ngrcfile)
char *ngrcfile;
#else
ttykeymapinit()
#endif
{
#ifndef TCCONIO
	extern	char *KS;
#endif
#ifndef	NO_STARTUP
	char *cp, *startupfile();

	if (cp = gettermtype()) {
#ifdef	ADDOPT
		if (((cp = startupfile(ngrcfile, cp)) != NULL)
#else
		if (((cp = startupfile(cp)) != NULL)
#endif
			&& (load(cp) != TRUE))
			ewprintf("Error reading key initialization file");
	}
#endif
}

/*
 * Start keypad mode -- called by update() and spawncli()
 */
ttykeypadstart()
{
#ifndef	TCCONIO
	extern	char *KS;
	if (KS && *KS)			/* turn on keypad	*/
		putpad(KS, 1);
#endif
}

/*
 * Clean up the keyboard -- called by tttidy() and spawncli()
 */
ttykeymaptidy()
{
#ifndef	TCCONIO
	extern	char *KE;

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

#endif