doxygen: prevent GPL license block from being parsed as doxygen comment.
[blender.git] / source / gameengine / GamePlayer / ghost / GPG_KeyboardDevice.cpp
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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  * GHOST Blender Player keyboard device implementation.
29  */
30
31 #include "GPG_KeyboardDevice.h"
32
33 GPG_KeyboardDevice::GPG_KeyboardDevice(void)
34 {
35         m_reverseKeyTranslateTable[GHOST_kKeyA                     ] = KX_AKEY                    ;                  
36         m_reverseKeyTranslateTable[GHOST_kKeyB                     ] = KX_BKEY                    ;                  
37         m_reverseKeyTranslateTable[GHOST_kKeyC                     ] = KX_CKEY                    ;                  
38         m_reverseKeyTranslateTable[GHOST_kKeyD                     ] = KX_DKEY                    ;                  
39         m_reverseKeyTranslateTable[GHOST_kKeyE                     ] = KX_EKEY                    ;                  
40         m_reverseKeyTranslateTable[GHOST_kKeyF                     ] = KX_FKEY                    ;                  
41         m_reverseKeyTranslateTable[GHOST_kKeyG                     ] = KX_GKEY                    ;                  
42         m_reverseKeyTranslateTable[GHOST_kKeyH                     ] = KX_HKEY                    ;                  
43         m_reverseKeyTranslateTable[GHOST_kKeyI                     ] = KX_IKEY                    ;                  
44         m_reverseKeyTranslateTable[GHOST_kKeyJ                     ] = KX_JKEY                    ;                  
45         m_reverseKeyTranslateTable[GHOST_kKeyK                     ] = KX_KKEY                    ;                  
46         m_reverseKeyTranslateTable[GHOST_kKeyL                     ] = KX_LKEY                    ;                  
47         m_reverseKeyTranslateTable[GHOST_kKeyM                     ] = KX_MKEY                    ;                  
48         m_reverseKeyTranslateTable[GHOST_kKeyN                     ] = KX_NKEY                    ;                  
49         m_reverseKeyTranslateTable[GHOST_kKeyO                     ] = KX_OKEY                    ;                  
50         m_reverseKeyTranslateTable[GHOST_kKeyP                     ] = KX_PKEY                    ;                  
51         m_reverseKeyTranslateTable[GHOST_kKeyQ                     ] = KX_QKEY                    ;                  
52         m_reverseKeyTranslateTable[GHOST_kKeyR                     ] = KX_RKEY                    ;                  
53         m_reverseKeyTranslateTable[GHOST_kKeyS                     ] = KX_SKEY                    ;                  
54         m_reverseKeyTranslateTable[GHOST_kKeyT                     ] = KX_TKEY                    ;                  
55         m_reverseKeyTranslateTable[GHOST_kKeyU                     ] = KX_UKEY                    ;                  
56         m_reverseKeyTranslateTable[GHOST_kKeyV                     ] = KX_VKEY                    ;                  
57         m_reverseKeyTranslateTable[GHOST_kKeyW                     ] = KX_WKEY                    ;                  
58         m_reverseKeyTranslateTable[GHOST_kKeyX                     ] = KX_XKEY                    ;                  
59         m_reverseKeyTranslateTable[GHOST_kKeyY                     ] = KX_YKEY                    ;                  
60         m_reverseKeyTranslateTable[GHOST_kKeyZ                     ] = KX_ZKEY                    ;                  
61
62         m_reverseKeyTranslateTable[GHOST_kKey0                     ] = KX_ZEROKEY                 ;                  
63         m_reverseKeyTranslateTable[GHOST_kKey1                     ] = KX_ONEKEY                  ;                  
64         m_reverseKeyTranslateTable[GHOST_kKey2                     ] = KX_TWOKEY                  ;                  
65         m_reverseKeyTranslateTable[GHOST_kKey3                     ] = KX_THREEKEY                ;                  
66         m_reverseKeyTranslateTable[GHOST_kKey4                     ] = KX_FOURKEY                 ;                  
67         m_reverseKeyTranslateTable[GHOST_kKey5                     ] = KX_FIVEKEY                 ;                  
68         m_reverseKeyTranslateTable[GHOST_kKey6                     ] = KX_SIXKEY                  ;                  
69         m_reverseKeyTranslateTable[GHOST_kKey7                     ] = KX_SEVENKEY                ;                  
70         m_reverseKeyTranslateTable[GHOST_kKey8                     ] = KX_EIGHTKEY                ;                  
71         m_reverseKeyTranslateTable[GHOST_kKey9                     ] = KX_NINEKEY                 ;
72         
73         // Middle keyboard area keys
74         m_reverseKeyTranslateTable[GHOST_kKeyPause                 ] = KX_PAUSEKEY                ;                  
75         m_reverseKeyTranslateTable[GHOST_kKeyInsert                ] = KX_INSERTKEY               ;                  
76         m_reverseKeyTranslateTable[GHOST_kKeyDelete                ] = KX_DELKEY                  ;                  
77         m_reverseKeyTranslateTable[GHOST_kKeyHome                  ] = KX_HOMEKEY                 ;                  
78         m_reverseKeyTranslateTable[GHOST_kKeyEnd                   ] = KX_ENDKEY                  ;                  
79         m_reverseKeyTranslateTable[GHOST_kKeyUpPage                ] = KX_PAGEUPKEY               ;                  
80         m_reverseKeyTranslateTable[GHOST_kKeyDownPage              ] = KX_PAGEDOWNKEY             ;                  
81         
82         // Arrow keys
83         m_reverseKeyTranslateTable[GHOST_kKeyUpArrow               ] = KX_UPARROWKEY              ;                  
84         m_reverseKeyTranslateTable[GHOST_kKeyDownArrow             ] = KX_DOWNARROWKEY            ;                  
85         m_reverseKeyTranslateTable[GHOST_kKeyLeftArrow             ] = KX_LEFTARROWKEY            ;                  
86         m_reverseKeyTranslateTable[GHOST_kKeyRightArrow            ] = KX_RIGHTARROWKEY           ;                  
87
88         // Function keys
89         m_reverseKeyTranslateTable[GHOST_kKeyF1                    ] = KX_F1KEY                   ;                  
90         m_reverseKeyTranslateTable[GHOST_kKeyF2                    ] = KX_F2KEY                   ;                  
91         m_reverseKeyTranslateTable[GHOST_kKeyF3                    ] = KX_F3KEY                   ;                  
92         m_reverseKeyTranslateTable[GHOST_kKeyF4                    ] = KX_F4KEY                   ;                  
93         m_reverseKeyTranslateTable[GHOST_kKeyF5                    ] = KX_F5KEY                   ;                  
94         m_reverseKeyTranslateTable[GHOST_kKeyF6                    ] = KX_F6KEY                   ;                  
95         m_reverseKeyTranslateTable[GHOST_kKeyF7                    ] = KX_F7KEY                   ;                  
96         m_reverseKeyTranslateTable[GHOST_kKeyF8                    ] = KX_F8KEY                   ;                  
97         m_reverseKeyTranslateTable[GHOST_kKeyF9                    ] = KX_F9KEY                   ;                  
98         m_reverseKeyTranslateTable[GHOST_kKeyF10                   ] = KX_F10KEY                  ;                  
99         m_reverseKeyTranslateTable[GHOST_kKeyF11                   ] = KX_F11KEY                  ;                  
100         m_reverseKeyTranslateTable[GHOST_kKeyF12                   ] = KX_F12KEY                  ;
101         m_reverseKeyTranslateTable[GHOST_kKeyF13                   ] = KX_F13KEY                  ;
102         m_reverseKeyTranslateTable[GHOST_kKeyF14                   ] = KX_F14KEY                  ;
103         m_reverseKeyTranslateTable[GHOST_kKeyF15                   ] = KX_F15KEY                  ;
104         m_reverseKeyTranslateTable[GHOST_kKeyF16                   ] = KX_F16KEY                  ;
105         m_reverseKeyTranslateTable[GHOST_kKeyF17                   ] = KX_F17KEY                  ;
106         m_reverseKeyTranslateTable[GHOST_kKeyF18                   ] = KX_F18KEY                  ;
107         m_reverseKeyTranslateTable[GHOST_kKeyF19                   ] = KX_F19KEY                  ;
108         
109
110         // Numpad keys
111         m_reverseKeyTranslateTable[GHOST_kKeyNumpad0               ] = KX_PAD0                     ;                  
112         m_reverseKeyTranslateTable[GHOST_kKeyNumpad1               ] = KX_PAD1                     ;                  
113         m_reverseKeyTranslateTable[GHOST_kKeyNumpad2               ] = KX_PAD2                     ;                  
114         m_reverseKeyTranslateTable[GHOST_kKeyNumpad3               ] = KX_PAD3                     ;                  
115         m_reverseKeyTranslateTable[GHOST_kKeyNumpad4               ] = KX_PAD4                     ;                  
116         m_reverseKeyTranslateTable[GHOST_kKeyNumpad5               ] = KX_PAD5                     ;                  
117         m_reverseKeyTranslateTable[GHOST_kKeyNumpad6               ] = KX_PAD6                     ;                  
118         m_reverseKeyTranslateTable[GHOST_kKeyNumpad7               ] = KX_PAD7                     ;                  
119         m_reverseKeyTranslateTable[GHOST_kKeyNumpad8               ] = KX_PAD8                     ;                                                                                                       
120         m_reverseKeyTranslateTable[GHOST_kKeyNumpad9               ] = KX_PAD9                     ;                  
121         m_reverseKeyTranslateTable[GHOST_kKeyNumpadAsterisk        ] = KX_PADASTERKEY              ;                                                                                                                                                                                                                                   
122         m_reverseKeyTranslateTable[GHOST_kKeyNumpadPlus            ] = KX_PADPLUSKEY               ;                  
123         m_reverseKeyTranslateTable[GHOST_kKeyNumpadPeriod          ] = KX_PADPERIOD                ;                  
124         m_reverseKeyTranslateTable[GHOST_kKeyNumpadMinus           ] = KX_PADMINUS                 ;                  
125         m_reverseKeyTranslateTable[GHOST_kKeyNumpadSlash           ] = KX_PADSLASHKEY            ;                  
126         m_reverseKeyTranslateTable[GHOST_kKeyNumpadEnter           ] = KX_PADENTER                 ;                  
127
128         // Other keys
129         m_reverseKeyTranslateTable[GHOST_kKeyCapsLock              ] = KX_CAPSLOCKKEY              ;                  
130         m_reverseKeyTranslateTable[GHOST_kKeyEsc                   ] = KX_ESCKEY                   ;                  
131         m_reverseKeyTranslateTable[GHOST_kKeyTab                   ] = KX_TABKEY                   ;                  
132         m_reverseKeyTranslateTable[GHOST_kKeySpace                 ] = KX_SPACEKEY                 ;                  
133         m_reverseKeyTranslateTable[GHOST_kKeyEnter                 ] = KX_RETKEY                               ;                  
134         m_reverseKeyTranslateTable[GHOST_kKeyBackSpace             ] = KX_BACKSPACEKEY             ;                  
135         m_reverseKeyTranslateTable[GHOST_kKeySemicolon             ] = KX_SEMICOLONKEY             ;                  
136         m_reverseKeyTranslateTable[GHOST_kKeyPeriod                ] = KX_PERIODKEY                ;                  
137         m_reverseKeyTranslateTable[GHOST_kKeyComma                 ] = KX_COMMAKEY                 ;                  
138         m_reverseKeyTranslateTable[GHOST_kKeyQuote                 ] = KX_QUOTEKEY                 ;                  
139         m_reverseKeyTranslateTable[GHOST_kKeyAccentGrave           ] = KX_ACCENTGRAVEKEY           ;                  
140         m_reverseKeyTranslateTable[GHOST_kKeyMinus                 ] = KX_MINUSKEY                 ;                  
141         m_reverseKeyTranslateTable[GHOST_kKeySlash                     ] = KX_SLASHKEY                 ;                  
142         m_reverseKeyTranslateTable[GHOST_kKeyBackslash             ] = KX_BACKSLASHKEY             ;                  
143         m_reverseKeyTranslateTable[GHOST_kKeyEqual                 ] = KX_EQUALKEY                 ;                  
144         m_reverseKeyTranslateTable[GHOST_kKeyLeftBracket               ] = KX_LEFTBRACKETKEY           ;                  
145         m_reverseKeyTranslateTable[GHOST_kKeyRightBracket              ] = KX_RIGHTBRACKETKEY          ;                  
146
147         // Modifier keys.
148         m_reverseKeyTranslateTable[GHOST_kKeyLeftControl               ] = KX_LEFTCTRLKEY                  ;                  
149         m_reverseKeyTranslateTable[GHOST_kKeyRightControl              ] = KX_RIGHTCTRLKEY                 ;                  
150         m_reverseKeyTranslateTable[GHOST_kKeyLeftAlt               ] = KX_LEFTALTKEY               ;                  
151         m_reverseKeyTranslateTable[GHOST_kKeyRightAlt              ] = KX_RIGHTALTKEY              ;                  
152         m_reverseKeyTranslateTable[GHOST_kKeyLeftShift             ] = KX_LEFTSHIFTKEY             ;                  
153         m_reverseKeyTranslateTable[GHOST_kKeyRightShift            ] = KX_RIGHTSHIFTKEY            ;                  
154 }
155
156
157 GPG_KeyboardDevice::~GPG_KeyboardDevice(void)
158 {
159 }