1 /*
2  * linux/drivers/acorn/char/defkeymap-l7200.c
3  *
4  * Default keyboard maps for LinkUp Systems L7200 board
5  *
6  * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
7  *
8  * Changelog:
9  *   08-04-2000 SJH     Created file
10  */
11 
12 #include <linux/types.h>
13 #include <linux/keyboard.h>
14 #include <linux/kd.h>
15 
16 /* Normal (maps 1:1 with no processing) */
17 #define KTn	0xF0
18 /* Function keys */
19 #define KTf	0xF1
20 /* Special (Performs special house-keeping funcs) */
21 #define KTs	0xF2
22 #define KIGNORE		K(KTs, 0)	/* Ignore */
23 #define KENTER		K(KTs, 1)	/* Enter */
24 #define KREGS		K(KTs, 2)	/* Regs */
25 #define KMEM		K(KTs, 3)	/* Mem */
26 #define KSTAT		K(KTs, 4)	/* State */
27 #define KINTR		K(KTs, 5)	/* Intr */
28 #define Ksl	6	/* Last console */
29 #define KCAPSLK		K(KTs, 7)	/* Caps lock */
30 #define KNUMLK		K(KTs, 8)	/* Num-lock */
31 #define KSCRLLK		K(KTs, 9)	/* Scroll-lock */
32 #define KSCRLFOR	K(KTs,10)	/* Scroll forward */
33 #define KSCRLBAK	K(KTs,11)	/* Scroll back */
34 #define KREBOOT		K(KTs,12)	/* Reboot */
35 #define KCAPSON		K(KTs,13)	/* Caps on */
36 #define KCOMPOSE	K(KTs,14)	/* Compose */
37 #define KSAK		K(KTs,15)	/* SAK */
38 #define CONS_DEC	K(KTs,16)	/* Dec console */
39 #define CONS_INC	K(KTs,17)	/* Incr console */
40 #define KFLOPPY		K(KTs,18)	/* Floppy */
41 /* Key pad (0-9 = digits, 10=+, 11=-, 12=*, 13=/, 14=enter, 16=., 17=# */
42 #define KTp	0xF3
43 #define KPAD_0		K(KTp, 0 )
44 #define KPAD_1  	K(KTp, 1 )
45 #define KPAD_2		K(KTp, 2 )
46 #define KPAD_3		K(KTp, 3 )
47 #define KPAD_4		K(KTp, 4 )
48 #define KPAD_5		K(KTp, 5 )
49 #define KPAD_6		K(KTp, 6 )
50 #define KPAD_7		K(KTp, 7 )
51 #define KPAD_8		K(KTp, 8 )
52 #define KPAD_9		K(KTp, 9 )
53 #define KPAD_PL		K(KTp,10 )
54 #define KPAD_MI		K(KTp,11 )
55 #define KPAD_ML		K(KTp,12 )
56 #define KPAD_DV		K(KTp,13 )
57 #define KPAD_EN		K(KTp,14 )
58 #define KPAD_DT		K(KTp,16 )
59 #define KPAD_HS		K(KTp,20 )
60 /* Console switching */
61 #define KCn	0xF5
62 /* Cursor */
63 #define KTc	0xF6
64 #define Kcd	0	/* Cursor down */
65 #define Kcl	1	/* Cursor left */
66 #define Kcr	2	/* Cursor right */
67 #define Kcu	3	/* Cursor up */
68 /* Shift/alt modifiers etc */
69 #define KMd	0xF7
70 #define KSHIFT		K(KMd, 0 )
71 #define KALTGR		K(KMd, 1 )
72 #define KCTRL		K(KMd, 2 )
73 #define KALT		K(KMd, 3 )
74 /* Meta */
75 #define KMt	0xF8
76 #define KAs	0xF9
77 #define KPADA_0		K(KAs, 0 )
78 #define KPADA_1		K(KAs, 1 )
79 #define KPADA_2		K(KAs, 2 )
80 #define KPADA_3		K(KAs, 3 )
81 #define KPADA_4		K(KAs, 4 )
82 #define KPADA_5		K(KAs, 5 )
83 #define KPADA_6		K(KAs, 6 )
84 #define KPADA_7		K(KAs, 7 )
85 #define KPADA_8		K(KAs, 8 )
86 #define KPADA_9		K(KAs, 9 )
87 #define KPADB_0		K(KAs,10 )
88 #define KPADB_1		K(KAs,11 )
89 #define KPADB_2		K(KAs,12 )
90 #define KPADB_3		K(KAs,13 )
91 #define KPADB_4		K(KAs,14 )
92 #define KPADB_5		K(KAs,15 )
93 #define KPADB_6		K(KAs,16 )
94 #define KPADB_7		K(KAs,17 )
95 #define KPADB_8		K(KAs,18 )
96 #define KPADB_9		K(KAs,19 )
97 /* Locking keys */
98 #define KLk	0xFA
99 /* Letters */
100 #define KTl	0xFB
101 
102 /*
103  * Here is the layout of the keys for the Fujitsu QWERTY
104  * style keyboard:
105  *
106  *	static char Fujitsu_Key_Table[] =
107  *	{
108  *        KALT, '`' , KNUL, KCTL, KFUN, KESC, '1' , '2' ,
109  *	  '9' , '0' , '-' , '=' , KNUL, KBSP, KNUL, KNUL,
110  *	  KNUL, KBSL, KSHF, KNUL, KNUL, KDEL, KNUL, 't' ,
111  *	  'y' , 'u' , 'i' , KRET, KSHF, KPGD, KNUL, KNUL,
112  *	  KNUL, KTAB, KNUL, KNUL, KNUL, 'q' , 'w' , 'e' ,
113  *	  'r' , 'o' , 'p' , '[' , KNUL, ']' , KNUL, KNUL,
114  *	  KNUL, 'z' , KNUL, KNUL, KNUL, KSHL, KNUL, KNUL,
115  *	  'k' , 'l' , ';' , KSQT, KNUL, KPGU, KNUL, KNUL,
116  *	  KNUL, 'a' , KNUL, KNUL, KNUL, 's' , 'd' , 'f' ,
117  *	  'g' , 'h' , 'j' , '/' , KNUL, KHME, KNUL, KNUL,
118  *	  KNUL, 'x' , KNUL, KNUL, KNUL, 'c' , 'v' , 'b' ,
119  *	  'n' , 'm' , ',' , '.' , KNUL, ' ' , KNUL, KNUL,
120  *	  KNUL, KNUL, KNUL, KNUL, KNUL, '3' , '4' , '5' ,
121  *	  '6' , '7' , '8' , KNUL, KPRG, KNUL, KEND, KNUL,
122  *	};
123  */
124 
125 u_short plain_map[NR_KEYS]=
126 {
127 	0xf703, 0xf060, 0xf200, 0xf702, 0xf200, 0xf01b, 0xf031, 0xf032,
128 	0xf039, 0xf030, 0xf02d, 0xf03d, 0xf200, 0xf07f, 0xf200, 0xf200,
129 	0xf200, 0xf05c, 0xf700, 0xf200, 0xf200, 0xf116, 0xf000, 0xfb74,
130 	0xfb79, 0xfb75, 0xfb69, 0xf201, 0xf700, 0xf600, 0xf200, 0xf200,
131 	0xf200, 0xf009, 0xf200, 0xf200, 0xf200, 0xfb71, 0xfb77, 0xfb65,
132 	0xfb72, 0xfb6f, 0xfb70, 0xf05b, 0xf200, 0xf05d, 0xf200, 0xf200,
133 	0xf200, 0xfb7a, 0xf200, 0xf200, 0xf200, 0xf207, 0xf200, 0xf200,
134 	0xfb6b, 0xfb6c, 0xf03b, 0xf027, 0xf200, 0xf603, 0xf200, 0xf200,
135 	0xf200, 0xfb61, 0xf200, 0xf200, 0xf200, 0xfb73, 0xfb64, 0xfb66,
136 	0xfb67, 0xfb68, 0xfb6a, 0xf02f, 0xf200, 0xf601, 0xf200, 0xf200,
137 	0xf200, 0xfb78, 0xf200, 0xf200, 0xf200, 0xfb63, 0xfb76, 0xfb62,
138 	0xfb6e, 0xfb6d, 0xf02c, 0xf02e, 0xf200, 0xf020, 0xf200, 0xf200,
139 	0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf033, 0xf034, 0xf035,
140 	0xf036, 0xf037, 0xf038, 0xf200, 0xf200, 0xf200, 0xf602, 0xf200,
141 	0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
142 	0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
143 };
144 
145 u_short shift_map[NR_KEYS]=
146 {
147 	0xf703, 0xf07e, 0xf200, 0xf702, 0xf200, 0xf01b, 0xf021, 0xf040,
148 	0xf028, 0xf029, 0xf05f, 0xf02b, 0xf200, 0xf07f, 0xf200, 0xf200,
149 	0xf200, 0xf07c, 0xf700, 0xf200, 0xf200, 0xf116, 0xf000, 0xfb54,
150 	0xfb59, 0xfb55, 0xfb49, 0xf201, 0xf700, 0xf600, 0xf200, 0xf200,
151  	0xf200, 0xf009, 0xf200, 0xf200, 0xf200, 0xfb51, 0xfb57, 0xfb45,
152 	0xfb52, 0xfb4f, 0xfb50, 0xf07b, 0xf200, 0xf07d, 0xf200, 0xf200,
153 	0xf200, 0xfb5a, 0xf200, 0xf200, 0xf200, 0xf207, 0xf200, 0xf200,
154 	0xfb4b, 0xfb4c, 0xf03a, 0xf022, 0xf200, 0xf603, 0xf200, 0xf200,
155 	0xf200, 0xfb41, 0xf200, 0xf200, 0xf200, 0xfb53, 0xfb44, 0xfb46,
156 	0xfb47, 0xfb48, 0xfb4a, 0xf03f, 0xf200, 0xf601, 0xf200, 0xf200,
157 	0xf200, 0xfb58, 0xf200, 0xf200, 0xf200, 0xfb43, 0xfb56, 0xfb42,
158 	0xfb4e, 0xfb4d, 0xf03c, 0xf03e, 0xf200, 0xf020, 0xf200, 0xf200,
159 	0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf023, 0xf024, 0xf025,
160 	0xf05e, 0xf026, 0xf02a, 0xf200, 0xf200, 0xf200, 0xf602, 0xf200,
161 	0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
162 	0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
163 };
164 
165 u_short altgr_map[NR_KEYS]=
166 {
167   KIGNORE   ,K(KCn,12 ),K(KCn,13 ),K(KCn,14  ),K(KCn,15 ),K(KCn,16 ),K(KCn,17  ),K(KCn, 18),
168   K(KCn, 19),K(KCn,20 ),K(KCn,21 ),K(KCn,22  ),K(KCn,23 ),KIGNORE   ,KREGS      ,KINTR     ,
169   KIGNORE   ,KIGNORE   ,K(KTn,'@'),KIGNORE    ,K(KTn,'$'),KIGNORE   ,KIGNORE    ,K(KTn,'{'),
170   K(KTn,'['),K(KTn,']'),K(KTn,'}'),K(KTn,'\\'),KIGNORE   ,KIGNORE   ,KIGNORE    ,K(KTf,21 ),
171   K(KTf,20 ),K(KTf,24 ),KNUMLK    ,KPAD_DV    ,KPAD_ML   ,KPAD_HS   ,KIGNORE    ,K(KTl,'q'),
172   K(KTl,'w'),K(KTl,'e'),K(KTl,'r'),K(KTl,'t' ),K(KTl,'y'),K(KTl,'u'),K(KTl,'i' ),K(KTl,'o'),
173   K(KTl,'p'),KIGNORE   ,K(KTn,'~'),KIGNORE    ,K(KTf,22 ),K(KTf,23 ),K(KTf,25  ),KPADB_7   ,
174   KPADB_8   ,KPADB_9   ,KPAD_MI   ,KCTRL      ,K(KAs,20 ),K(KTl,'s'),K(KAs,23  ),K(KAs,25 ),
175   K(KTl,'g'),K(KTl,'h'),K(KTl,'j'),K(KTl,'k' ),K(KTl,'l'),KIGNORE   ,KIGNORE    ,KENTER    ,
176   KPADB_4   ,KPADB_5   ,KPADB_6   ,KPAD_PL    ,KSHIFT    ,KIGNORE   ,K(KTl,'z' ),K(KTl,'x'),
177   K(KAs,22 ),K(KTl,'v'),K(KTl,21 ),K(KTl,'n' ),K(KTl,'m'),KIGNORE   ,KIGNORE    ,KIGNORE   ,
178   KSHIFT    ,K(KTc,Kcu),KPADB_1   ,KPADB_2    ,KPADB_3   ,KCAPSLK   ,KALT       ,KIGNORE   ,
179   KALTGR    ,KCTRL     ,K(KTc,Kcl),K(KTc,Kcd ),K(KTc,Kcr),KPADB_0   ,KPAD_DT    ,KPAD_EN   ,
180   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
181   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
182   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
183 };
184 
185 u_short ctrl_map[NR_KEYS]=
186 {
187 	0xf703, 0xf200, 0xf200, 0xf702, 0xf200, 0xf200, 0xf001, 0xf002,
188 	0xf009, 0xf000, 0xf031, 0xf200, 0xf200, 0xf07f, 0xf200, 0xf200,
189 	0xf200, 0xf01c, 0xf700, 0xf200, 0xf200, 0xf116, 0xf000, 0xf020,
190 	0xf019, 0xf015, 0xf009, 0xf201, 0xf700, 0xf600, 0xf200, 0xf200,
191 	0xf200, 0xf009, 0xf200, 0xf200, 0xf200, 0xf011, 0xf017, 0xf005,
192 	0xf012, 0xf00f, 0xf010, 0xf01b, 0xf200, 0xf01d, 0xf200, 0xf200,
193 	0xf200, 0xf01a, 0xf200, 0xf200, 0xf200, 0xf207, 0xf200, 0xf200,
194 	0xf00b, 0xf00c, 0xf200, 0xf007, 0xf200, 0xf603, 0xf200, 0xf200,
195 	0xf200, 0xf001, 0xf200, 0xf200, 0xf200, 0xf001, 0xf013, 0xf006,
196 	0xf007, 0xf008, 0xf00a, 0xf07f, 0xf200, 0xf601, 0xf200, 0xf200,
197 	0xf200, 0xf018, 0xf200, 0xf200, 0xf200, 0xf003, 0xf016, 0xf002,
198 	0xf00e, 0xf00d, 0xf200, 0xf200, 0xf200, 0xf000, 0xf200, 0xf200,
199 	0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf01b, 0xf01c, 0xf01d,
200 	0xf036, 0xf037, 0xf038, 0xf200, 0xf200, 0xf200, 0xf602, 0xf200,
201 	0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
202 	0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf602, 0xf200,
203 };
204 
205 u_short shift_ctrl_map[NR_KEYS]=
206 {
207   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
208   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KFLOPPY    ,KINTR     ,
209   KIGNORE   ,KIGNORE   ,K(KTn, 0 ),KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
210   KIGNORE   ,KIGNORE   ,KIGNORE   ,K(KTn,31  ),KIGNORE   ,KIGNORE   ,KIGNORE    ,K(KTf,21 ),
211   K(KTf,20 ),K(KTf,24 ),KNUMLK    ,KPAD_DV    ,KPAD_ML   ,KPAD_HS   ,KIGNORE    ,K(KTn,17 ),
212   K(KTn,23 ),K(KTn, 5 ),K(KTn,18 ),K(KTn,20  ),K(KTn,25 ),K(KTn,21 ),K(KTn, 9  ),K(KTn,15 ),
213   K(KTn,16 ),KIGNORE   ,KIGNORE   ,KIGNORE    ,K(KTf,22 ),K(KTf,23 ),K(KTf,25  ),KPAD_7    ,
214   KPAD_8    ,KPAD_9    ,KPAD_MI   ,KCTRL      ,K(KTn, 1 ),K(KTn,19 ),K(KTn, 4  ),K(KTn, 6 ),
215   K(KTn, 7 ),K(KTn, 8 ),K(KTn,10 ),K(KTn,11  ),K(KTn,12 ),KIGNORE   ,K(KTn, 7  ),KENTER    ,
216   KPAD_4    ,KPAD_5    ,KPAD_6    ,KPAD_PL    ,KSHIFT    ,KIGNORE   ,K(KTn,26  ),K(KTn,24 ),
217   K(KTn, 3 ),K(KTn,22 ),K(KTn, 2 ),K(KTn,14  ),K(KTn,13 ),KIGNORE   ,KIGNORE    ,KIGNORE   ,
218   KSHIFT    ,K(KTc,Kcu),KPAD_1    ,KPAD_2     ,KPAD_3    ,KCAPSLK   ,KALT       ,K(KTn, 0 ),
219   KALTGR    ,KCTRL     ,K(KTc,Kcl),K(KTc,Kcd ),K(KTc,Kcr),KPAD_0    ,KPAD_DT    ,KPAD_EN   ,
220   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
221   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
222   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
223 };
224 
225 u_short alt_map[NR_KEYS]=
226 {
227   K(KMt,27 ),K(KCn, 0 ),K(KCn, 1 ),K(KCn, 2  ),K(KCn, 3 ),K(KCn, 4 ),K(KCn, 5  ),K(KCn, 6 ),
228   K(KCn, 7 ),K(KCn, 8 ),K(KCn, 9 ),K(KCn,10  ),K(KCn,11 ),KIGNORE   ,KSCRLLK    ,KINTR     ,
229   K(KMt,'`'),K(KMt,'1'),K(KMt,'2'),K(KMt,'3' ),K(KMt,'4'),K(KMt,'5'),K(KMt,'6' ),K(KMt,'7'),
230   K(KMt,'8'),K(KMt,'9'),K(KMt,'0'),K(KMt,'-' ),K(KMt,'='),K(KMt,'�'),K(KMt,127 ),K(KTf,21 ),
231   K(KTf,20 ),K(KTf,24 ),KNUMLK    ,KPAD_DV    ,KPAD_ML   ,KPAD_HS   ,K(KMt, 9  ),K(KMt,'q'),
232   K(KMt,'w'),K(KMt,'e'),K(KMt,'r'),K(KMt,'t' ),K(KMt,'y'),K(KMt,'u'),K(KMt,'i' ),K(KMt,'o'),
233   K(KMt,'p'),K(KMt,'['),K(KMt,']'),K(KMt,'\\'),K(KTf,22 ),K(KTf,23 ),K(KTf,25  ),KPADA_7   ,
234   KPADA_8   ,KPADA_9   ,KPAD_MI   ,KCTRL      ,K(KMt,'a'),K(KMt,'s'),K(KMt,'d' ),K(KMt,'f'),
235   K(KMt,'g'),K(KMt,'h'),K(KMt,'j'),K(KMt,'k' ),K(KMt,'l'),K(KMt,';'),K(KMt,'\''),K(KMt,13 ),
236   KPADA_4   ,KPADA_5   ,KPADA_6   ,KPAD_PL    ,KSHIFT    ,KIGNORE   ,K(KMt,'z' ),K(KMt,'x'),
237   K(KMt,'c'),K(KMt,'v'),K(KMt,'b'),K(KMt,'n' ),K(KMt,'m'),K(KMt,','),K(KMt,'.' ),KIGNORE   ,
238   KSHIFT    ,K(KTc,Kcu),KPADA_1   ,KPADA_2    ,KPADA_3   ,KCAPSLK   ,KALT       ,K(KMt,' '),
239   KALTGR    ,KCTRL     ,CONS_DEC  ,K(KTc,Kcd ),CONS_INC  ,KPADA_0   ,KPAD_DT    ,KPAD_EN   ,
240   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
241   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
242   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
243 };
244 
245 u_short ctrl_alt_map[NR_KEYS]=
246 {
247   KIGNORE   ,K(KCn, 0 ),K(KCn, 1 ),K(KCn, 2  ),K(KCn, 3 ),K(KCn, 4 ),K(KCn, 5  ),K(KCn, 6 ),
248   K(KCn, 7 ),K(KCn, 8 ),K(KCn, 9 ),K(KCn,10  ),K(KCn,11 ),KIGNORE   ,KIGNORE    ,KINTR     ,
249   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
250   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,K(KTf,21 ),
251   K(KTf,20 ),K(KTf,24 ),KNUMLK    ,KPAD_DV    ,KPAD_ML   ,KPAD_HS   ,KIGNORE    ,K(KMt,17 ),
252   K(KMt,23 ),K(KMt, 5 ),K(KMt,18 ),K(KMt,20  ),K(KMt,25 ),K(KMt,21 ),K(KMt, 9  ),K(KMt,15 ),
253   K(KMt,16 ),KIGNORE   ,KIGNORE   ,KIGNORE    ,KREBOOT   ,K(KTf,23 ),K(KTf,25  ),KPAD_7    ,
254   KPAD_8    ,KPAD_9    ,KPAD_MI   ,KCTRL      ,K(KMt, 1 ),K(KMt,19 ),K(KMt, 4  ),K(KMt, 6 ),
255   K(KMt, 7 ),K(KMt, 8 ),K(KMt,10 ),K(KMt,11  ),K(KMt,12 ),KIGNORE   ,KIGNORE    ,KENTER    ,
256   KPAD_4    ,KPAD_5    ,KPAD_6    ,KPAD_PL    ,KSHIFT    ,KIGNORE   ,K(KMt,26  ),K(KMt,24 ),
257   K(KMt, 3 ),K(KMt,22 ),K(KMt, 2 ),K(KMt,14  ),K(KMt,13 ),KIGNORE   ,KIGNORE    ,KIGNORE   ,
258   KSHIFT    ,K(KTc,Kcu),KPAD_1    ,KPAD_2     ,KPAD_3    ,KCAPSLK   ,KALT       ,KIGNORE   ,
259   KALTGR    ,KCTRL     ,K(KTc,Kcl),K(KTc,Kcd ),K(KTc,Kcr),KPAD_0    ,KREBOOT    ,KPAD_EN   ,
260   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
261   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
262   KIGNORE   ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,KIGNORE   ,KIGNORE    ,KIGNORE   ,
263 };
264 
265 ushort *key_maps[MAX_NR_KEYMAPS] = {
266 	plain_map, shift_map, altgr_map, 0,
267 	ctrl_map, shift_ctrl_map, 0, 0,
268 	alt_map, 0, 0, 0,
269 	ctrl_alt_map,	0
270 };
271 
272 unsigned int keymap_count = 7;
273 
274 /*
275  * Philosophy: most people do not define more strings, but they who do
276  * often want quite a lot of string space. So, we statically allocate
277  * the default and allocate dynamically in chunks of 512 bytes.
278  */
279 
280 char func_buf[] = {
281 	'\033', '[', '[', 'A', 0,
282 	'\033', '[', '[', 'B', 0,
283 	'\033', '[', '[', 'C', 0,
284 	'\033', '[', '[', 'D', 0,
285 	'\033', '[', '[', 'E', 0,
286 	'\033', '[', '1', '7', '~', 0,
287 	'\033', '[', '1', '8', '~', 0,
288 	'\033', '[', '1', '9', '~', 0,
289 	'\033', '[', '2', '0', '~', 0,
290 	'\033', '[', '2', '1', '~', 0,
291 	'\033', '[', '2', '3', '~', 0,
292 	'\033', '[', '2', '4', '~', 0,
293 	'\033', '[', '2', '5', '~', 0,
294 	'\033', '[', '2', '6', '~', 0,
295 	'\033', '[', '2', '8', '~', 0,
296 	'\033', '[', '2', '9', '~', 0,
297 	'\033', '[', '3', '1', '~', 0,
298 	'\033', '[', '3', '2', '~', 0,
299 	'\033', '[', '3', '3', '~', 0,
300 	'\033', '[', '3', '4', '~', 0,
301 	'\033', '[', '1', '~', 0,
302 	'\033', '[', '2', '~', 0,
303 	'\033', '[', '3', '~', 0,
304 	'\033', '[', '4', '~', 0,
305 	'\033', '[', '5', '~', 0,
306 	'\033', '[', '6', '~', 0,
307 	'\033', '[', 'M', 0,
308 	'\033', '[', 'P', 0,
309 };
310 
311 char *funcbufptr = func_buf;
312 int funcbufsize = sizeof(func_buf);
313 int funcbufleft = 0;          /* space left */
314 
315 char *func_table[MAX_NR_FUNC] = {
316 	func_buf + 0,
317 	func_buf + 5,
318 	func_buf + 10,
319 	func_buf + 15,
320 	func_buf + 20,
321 	func_buf + 25,
322 	func_buf + 31,
323 	func_buf + 37,
324 	func_buf + 43,
325 	func_buf + 49,
326 	func_buf + 55,
327 	func_buf + 61,
328 	func_buf + 67,
329 	func_buf + 73,
330 	func_buf + 79,
331 	func_buf + 85,
332 	func_buf + 91,
333 	func_buf + 97,
334 	func_buf + 103,
335 	func_buf + 109,
336 	func_buf + 115,
337 	func_buf + 120,
338 	func_buf + 125,
339 	func_buf + 130,
340 	func_buf + 135,
341 	func_buf + 140,
342 	func_buf + 145,
343 	0,
344 	0,
345 	func_buf + 149,
346 	0,
347 };
348 
349 struct kbdiacr accent_table[MAX_DIACR] = {
350 	{'`', 'A', '\300'},	{'`', 'a', '\340'},
351 	{'\'', 'A', '\301'},	{'\'', 'a', '\341'},
352 	{'^', 'A', '\302'},	{'^', 'a', '\342'},
353 	{'~', 'A', '\303'},	{'~', 'a', '\343'},
354 	{'"', 'A', '\304'},	{'"', 'a', '\344'},
355 	{'O', 'A', '\305'},	{'o', 'a', '\345'},
356 	{'0', 'A', '\305'},	{'0', 'a', '\345'},
357 	{'A', 'A', '\305'},	{'a', 'a', '\345'},
358 	{'A', 'E', '\306'},	{'a', 'e', '\346'},
359 	{',', 'C', '\307'},	{',', 'c', '\347'},
360 	{'`', 'E', '\310'},	{'`', 'e', '\350'},
361 	{'\'', 'E', '\311'},	{'\'', 'e', '\351'},
362 	{'^', 'E', '\312'},	{'^', 'e', '\352'},
363 	{'"', 'E', '\313'},	{'"', 'e', '\353'},
364 	{'`', 'I', '\314'},	{'`', 'i', '\354'},
365 	{'\'', 'I', '\315'},	{'\'', 'i', '\355'},
366 	{'^', 'I', '\316'},	{'^', 'i', '\356'},
367 	{'"', 'I', '\317'},	{'"', 'i', '\357'},
368 	{'-', 'D', '\320'},	{'-', 'd', '\360'},
369 	{'~', 'N', '\321'},	{'~', 'n', '\361'},
370 	{'`', 'O', '\322'},	{'`', 'o', '\362'},
371 	{'\'', 'O', '\323'},	{'\'', 'o', '\363'},
372 	{'^', 'O', '\324'},	{'^', 'o', '\364'},
373 	{'~', 'O', '\325'},	{'~', 'o', '\365'},
374 	{'"', 'O', '\326'},	{'"', 'o', '\366'},
375 	{'/', 'O', '\330'},	{'/', 'o', '\370'},
376 	{'`', 'U', '\331'},	{'`', 'u', '\371'},
377 	{'\'', 'U', '\332'},	{'\'', 'u', '\372'},
378 	{'^', 'U', '\333'},	{'^', 'u', '\373'},
379 	{'"', 'U', '\334'},	{'"', 'u', '\374'},
380 	{'\'', 'Y', '\335'},	{'\'', 'y', '\375'},
381 	{'T', 'H', '\336'},	{'t', 'h', '\376'},
382 	{'s', 's', '\337'},	{'"', 'y', '\377'},
383 	{'s', 'z', '\337'},	{'i', 'j', '\377'},
384 };
385 
386 unsigned int accent_table_size = 68;
387