xref: /plan9/sys/include/keyboard.h (revision 50e5f38d649a06ef8aef42696e09b6c4c5964957)
1 #pragma src "/sys/src/libdraw"
2 #pragma lib "libdraw.a"
3 
4 typedef struct 	Keyboardctl Keyboardctl;
5 typedef struct	Channel	Channel;
6 
7 struct	Keyboardctl
8 {
9 	Channel	*c;	/* chan(Rune)[20] */
10 
11 	char		*file;
12 	int		consfd;		/* to cons file */
13 	int		ctlfd;		/* to ctl file */
14 	int		pid;		/* of slave proc */
15 };
16 
17 
18 extern	Keyboardctl*	initkeyboard(char*);
19 extern	int		ctlkeyboard(Keyboardctl*, char*);
20 extern	void		closekeyboard(Keyboardctl*);
21 
22 enum {
23 	KF=	0xF000,	/* Rune: beginning of private Unicode space */
24 	Spec=	0xF800,
25 	/* KF|1, KF|2, ..., KF|0xC is F1, F2, ..., F12 */
26 	Khome=	KF|0x0D,
27 	Kup=	KF|0x0E,
28 	Kpgup=	KF|0x0F,
29 	Kprint=	KF|0x10,
30 	Kleft=	KF|0x11,
31 	Kright=	KF|0x12,
32 	Kdown=	Spec|0x00,
33 	Kview=	Spec|0x00,
34 	Kpgdown=	KF|0x13,
35 	Kins=	KF|0x14,
36 	Kend=	KF|0x18,
37 
38 	Kalt=		KF|0x15,
39 	Kshift=	KF|0x16,
40 	Kctl=		KF|0x17,
41 
42 	Kbs=	0x08,
43 	Kdel=	0x7f,
44 	Kesc=	0x1b,
45 	Keof=	0x04,
46 };
47