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