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