xref: /csrg-svn/sys/news3400/iop/keyboard.h (revision 53887)
1*53887Smckusick /*
2*53887Smckusick  * Copyright (c) 1992 The Regents of the University of California.
3*53887Smckusick  * All rights reserved.
4*53887Smckusick  *
5*53887Smckusick  * This code is derived from software contributed to Berkeley by
6*53887Smckusick  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
7*53887Smckusick  *
8*53887Smckusick  * %sccs.include.redist.c%
9*53887Smckusick  *
10*53887Smckusick  * from: $Hdr: keyboard.h,v 4.300 91/06/09 06:42:48 root Rel41 $ SONY
11*53887Smckusick  *
12*53887Smckusick  *	@(#)keyboard.h	7.1 (Berkeley) 06/04/92
13*53887Smckusick  */
14*53887Smckusick 
15*53887Smckusick /*
16*53887Smckusick  *	Key flag
17*53887Smckusick  */
18*53887Smckusick #define	NORMAL		0x003f
19*53887Smckusick #define		N	0x0001
20*53887Smckusick #define		S	0x0002
21*53887Smckusick #define		C	0x0004
22*53887Smckusick #define		A	0x0008
23*53887Smckusick #define		K	0x0010
24*53887Smckusick #define		G	0x0010
25*53887Smckusick #define		J	0x0020
26*53887Smckusick #define		L	0x0040
27*53887Smckusick #define		R	0x0080
28*53887Smckusick #define		O	(L|R)
29*53887Smckusick 
30*53887Smckusick #define	PRG_FUNC	0x0100
31*53887Smckusick #define	ALT_FUNC	0x0200
32*53887Smckusick #define	CAP_LOCK	0x0400
33*53887Smckusick 
34*53887Smckusick #define	PSH_SHFT	0x0800
35*53887Smckusick #define	SW_SHFT		0x1000
36*53887Smckusick #define	KEY_PRESS	0x4000
37*53887Smckusick #define	NOT_REPT	0x8000
38*53887Smckusick 
39*53887Smckusick #define		S_CTRL	0
40*53887Smckusick #define		S_LSHFT	1
41*53887Smckusick #define		S_RSHFT	2
42*53887Smckusick #define		S_ALT	3
43*53887Smckusick #define		S_CAPS	4
44*53887Smckusick #define		S_AN	5
45*53887Smckusick #define		S_KANA	6
46*53887Smckusick #define		S_OCAPS	7
47*53887Smckusick #define		S_OKANA	8
48*53887Smckusick #define		S_ALTGR	9
49*53887Smckusick 
50*53887Smckusick /*
51*53887Smckusick  *	Keyboard status
52*53887Smckusick  */
53*53887Smckusick #define	KBD_SHIFT	0x0003		/* shift mode		*/
54*53887Smckusick #define	KBD_RSHIFT	0x0001
55*53887Smckusick #define	KBD_LSHIFT	0x0002
56*53887Smckusick #define	KBD_CTRL	0x0004		/* control mode		*/
57*53887Smckusick #define	KBD_ALT		0x0008		/* alternate mode	*/
58*53887Smckusick #define	KBD_CAPS	0x0010		/* capital lock mode	*/
59*53887Smckusick #define	KBD_KANA	0x0020		/* kana mode		*/
60*53887Smckusick #define	KBD_NOTREPT	0x0080		/* do not auto repeat	*/
61*53887Smckusick #define	KBD_ALTGR	0x0800		/* European keyboard AltGr mode	*/
62*53887Smckusick 
63*53887Smckusick /*
64*53887Smckusick  *	Lock type
65*53887Smckusick  */
66*53887Smckusick #define	CAPSLOCK	1
67*53887Smckusick #define	SHIFTLOCK	2
68*53887Smckusick #define	SHIFTLOCK2	3
69*53887Smckusick 
70*53887Smckusick /*
71*53887Smckusick  *	Country number
72*53887Smckusick  */
73*53887Smckusick #define	K_JAPANESE_J		0			/* JIS */
74*53887Smckusick #define	K_JAPANESE_O		1			/* OYAYUBI */
75*53887Smckusick #define	K_GERMAN		2
76*53887Smckusick #define	K_FRENCH		3
77*53887Smckusick #define	K_UKENGLISH		4
78*53887Smckusick #define	K_ITALIAN		5
79*53887Smckusick #define	K_SPANISH		6
80*53887Smckusick #define	K_SWEDISH_FINNISH	7
81*53887Smckusick #define	K_DANISH		8
82*53887Smckusick #define	K_NORWEGIAN		9
83*53887Smckusick #define	K_PORTUGUESE		10
84*53887Smckusick #define	K_USENGLISH		11
85*53887Smckusick 
86*53887Smckusick /*
87*53887Smckusick  *	Key shift code
88*53887Smckusick  */
89*53887Smckusick #define	PF_NORMAL	0
90*53887Smckusick #define	PF_SHIFT	1
91*53887Smckusick #define	PF_CONTROL	2
92*53887Smckusick #define	PF_ALTERNATE	3
93*53887Smckusick 
94*53887Smckusick typedef	struct key_table {
95*53887Smckusick 	short		key_flags;
96*53887Smckusick 	char		normal_code;
97*53887Smckusick 	char		shift_code;
98*53887Smckusick 	char		ctrl_code;
99*53887Smckusick 	char		alt_code;
100*53887Smckusick 	char		kana_code;
101*53887Smckusick 	char		kshft_code;
102*53887Smckusick } Key_table;
103*53887Smckusick 
104*53887Smckusick typedef struct {
105*53887Smckusick 	int		key_number;
106*53887Smckusick 	Key_table	key_num_table;
107*53887Smckusick } Key_tab_info;
108*53887Smckusick 
109*53887Smckusick /*
110*53887Smckusick  *	IOCTL command
111*53887Smckusick  */
112*53887Smckusick #define	KBIOCBELL	_IOW('K', 1, int)		/* ring bell	*/
113*53887Smckusick #define	KBIOCREPT	_IO('K', 3)			/* auto repeat on */
114*53887Smckusick #define	KBIOCNRPT	_IO('K', 4)			/* auto repeat off */
115*53887Smckusick #define	KBIOCSETLOCK	_IOW('K', 10, int)		/* set lock type */
116*53887Smckusick #define	KBIOCSETTBL	_IOW('K', 11, Key_tab_info)	/* set key_table */
117*53887Smckusick #define	KBIOCGETCNUM	_IOR('K', 12, int)		/* get country number */
118*53887Smckusick #define	KBIOCSETCNUM	_IOW('K', 13, int)		/* set country number */
119*53887Smckusick #define	KBIOCGETSTAT	_IOR('K', 17, int)		/* get status */
120*53887Smckusick #define	KBIOCSETSTAT	_IOW('K', 18, int)		/* set status */
121