dab4b4ae8394d1530f72b91393115ddfe919deaa
[blender-staging.git] / source / blender / src / keyval.c
1 /**
2  * $Id$
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19  *
20  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21  * All rights reserved.
22  *
23  * The Original Code is: all of this file.
24  *
25  * Contributor(s): none yet.
26  *
27  * ***** END GPL LICENSE BLOCK *****
28  */
29
30 #include "BLI_blenlib.h"
31 #include "BLI_arithb.h"
32 #include "BIF_keyval.h"
33 #include "blendef.h"
34 #include "mydevice.h"
35
36 #ifdef HAVE_CONFIG_H
37 #include <config.h>
38 #endif
39
40
41 char *key_event_to_string(unsigned short event)
42 {
43
44         switch(event) {
45         case AKEY:
46                 return "A";
47                 break;
48         case BKEY:
49                 return "B";
50                 break;
51         case CKEY:
52                 return "C";
53                 break;
54         case DKEY:
55                 return "D";
56                 break;
57         case EKEY:
58                 return "E";
59                 break;
60         case FKEY:
61                 return "F";
62                 break;
63         case GKEY:
64                 return "G";
65                 break;
66         case HKEY:
67                 return "H";
68                 break;
69         case IKEY:
70                 return "I";
71                 break;
72         case JKEY:
73                 return "J";
74                 break;
75         case KKEY:
76                 return "K";
77                 break;
78         case LKEY:
79                 return "L";
80                 break;
81         case MKEY:
82                 return "M";
83                 break;
84         case NKEY:
85                 return "N";
86                 break;
87         case OKEY:
88                 return "O";
89                 break;
90         case PKEY:
91                 return "P";
92                 break;
93         case QKEY:
94                 return "Q";
95                 break;
96         case RKEY:
97                 return "R";
98                 break;
99         case SKEY:
100                 return "S";
101                 break;
102         case TKEY:
103                 return "T";
104                 break;
105         case UKEY:
106                 return "U";
107                 break;
108         case VKEY:
109                 return "V";
110                 break;
111         case WKEY:
112                 return "W";
113                 break;
114         case XKEY:
115                 return "X";
116                 break;
117         case YKEY:
118                 return "Y";
119                 break;
120         case ZKEY:
121                 return "Z";
122                 break;
123
124         case ZEROKEY:
125                 return "Zero";
126                 break;
127         case ONEKEY:
128                 return "One";
129                 break;
130         case TWOKEY:
131                 return "Two";
132                 break;
133         case THREEKEY:
134                 return "Three";
135                 break;
136         case FOURKEY:
137                 return "Four";
138                 break;
139         case FIVEKEY:
140                 return "Five";
141                 break;
142         case SIXKEY:
143                 return "Six";
144                 break;
145         case SEVENKEY:
146                 return "Seven";
147                 break;
148         case EIGHTKEY:
149                 return "Eight";
150                 break;
151         case NINEKEY:
152                 return "Nine";
153                 break;
154
155         case LEFTCTRLKEY:
156                 return "Leftctrl";
157                 break;
158         case LEFTALTKEY:
159                 return "Leftalt";
160                 break;
161         case    RIGHTALTKEY:
162                 return "Rightalt";
163                 break;
164         case    RIGHTCTRLKEY:
165                 return "Rightctrl";
166                 break;
167         case RIGHTSHIFTKEY:
168                 return "Rightshift";
169                 break;
170         case LEFTSHIFTKEY:
171                 return "Leftshift";
172                 break;
173
174         case ESCKEY:
175                 return "Esc";
176                 break;
177         case TABKEY:
178                 return "Tab";
179                 break;
180         case RETKEY:
181                 return "Ret";
182                 break;
183         case SPACEKEY:
184                 return "Space";
185                 break;
186         case LINEFEEDKEY:
187                 return "Linefeed";
188                 break;
189         case BACKSPACEKEY:
190                 return "Backspace";
191                 break;
192         case DELKEY:
193                 return "Del";
194                 break;
195         case SEMICOLONKEY:
196                 return "Semicolon";
197                 break;
198         case PERIODKEY:
199                 return "Period";
200                 break;
201         case COMMAKEY:
202                 return "Comma";
203                 break;
204         case QUOTEKEY:
205                 return "Quote";
206                 break;
207         case ACCENTGRAVEKEY:
208                 return "Accentgrave";
209                 break;
210         case MINUSKEY:
211                 return "Minus";
212                 break;
213         case SLASHKEY:
214                 return "Slash";
215                 break;
216         case BACKSLASHKEY:
217                 return "Backslash";
218                 break;
219         case EQUALKEY:
220                 return "Equal";
221                 break;
222         case LEFTBRACKETKEY:
223                 return "Leftbracket";
224                 break;
225         case RIGHTBRACKETKEY:
226                 return "Rightbracket";
227                 break;
228
229         case LEFTARROWKEY:
230                 return "Leftarrow";
231                 break;
232         case DOWNARROWKEY:
233                 return "Downarrow";
234                 break;
235         case RIGHTARROWKEY:
236                 return "Rightarrow";
237                 break;
238         case UPARROWKEY:
239                 return "Uparrow";
240                 break;
241
242         case PAD2:
243                 return "Pad2";
244                 break;
245         case PAD4:
246                 return "Pad4";
247                 break;
248         case PAD6:
249                 return "Pad6";
250                 break;
251         case PAD8:
252                 return "Pad8";
253                 break;
254         case PAD1:
255                 return "Pad1";
256                 break;
257         case PAD3:
258                 return "Pad3";
259                 break;
260         case PAD5:
261                 return "Pad5";
262                 break;
263         case PAD7:
264                 return "Pad7";
265                 break;
266         case PAD9:
267                 return "Pad9";
268                 break;
269
270         case PADPERIOD:
271                 return "Padperiod";
272                 break;
273         case PADSLASHKEY:
274                 return "Padslash";
275                 break;
276         case PADASTERKEY:
277                 return "Padaster";
278                 break;
279
280         case PAD0:
281                 return "Pad0";
282                 break;
283         case PADMINUS:
284                 return "Padminus";
285                 break;
286         case PADENTER:
287                 return "Padenter";
288                 break;
289         case PADPLUSKEY:
290                 return "Padplus";
291                 break;
292
293         case    F1KEY:
294                 return "F1";
295                 break;
296         case    F2KEY:
297                 return "F2";
298                 break;
299         case    F3KEY:
300                 return "F3";
301                 break;
302         case    F4KEY:
303                 return "F4";
304                 break;
305         case    F5KEY:
306                 return "F5";
307                 break;
308         case    F6KEY:
309                 return "F6";
310                 break;
311         case    F7KEY:
312                 return "F7";
313                 break;
314         case    F8KEY:
315                 return "F8";
316                 break;
317         case    F9KEY:
318                 return "F9";
319                 break;
320         case    F10KEY:
321                 return "F10";
322                 break;
323         case    F11KEY:
324                 return "F11";
325                 break;
326         case    F12KEY:
327                 return "F12";
328                 break;
329
330         case    PAUSEKEY:
331                 return "Pause";
332                 break;
333         case    INSERTKEY:
334                 return "Insert";
335                 break;
336         case    HOMEKEY:
337                 return "Home";
338                 break;
339         case    PAGEUPKEY:
340                 return "Pageup";
341                 break;
342         case    PAGEDOWNKEY:
343                 return "Pagedown";
344                 break;
345         case    ENDKEY:
346                 return "End";
347                 break;
348         }
349         
350         return "";
351 }