OLD | NEW |
1 /* | 1 /* |
2 * $Id$ | 2 * $Id$ |
3 * ***** BEGIN GPL LICENSE BLOCK ***** | 3 * ***** BEGIN GPL LICENSE BLOCK ***** |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or | 5 * This program is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU General Public License | 6 * modify it under the terms of the GNU General Public License |
7 * as published by the Free Software Foundation; either version 2 | 7 * as published by the Free Software Foundation; either version 2 |
8 * of the License, or (at your option) any later version. | 8 * of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 19 matching lines...) Expand all Loading... |
30 * \ingroup blroutines | 30 * \ingroup blroutines |
31 */ | 31 */ |
32 | 32 |
33 | 33 |
34 #if defined(WIN32) && !defined(FREE_WINDOWS) | 34 #if defined(WIN32) && !defined(FREE_WINDOWS) |
35 // annoying warnings about truncated STL debug info | 35 // annoying warnings about truncated STL debug info |
36 #pragma warning (disable :4786) | 36 #pragma warning (disable :4786) |
37 #endif· | 37 #endif· |
38 | 38 |
39 #include "KX_BlenderKeyboardDevice.h" | 39 #include "KX_BlenderKeyboardDevice.h" |
| 40 #include "KX_KetsjiEngine.h" |
40 | 41 |
41 KX_BlenderKeyboardDevice::KX_BlenderKeyboardDevice() | 42 KX_BlenderKeyboardDevice::KX_BlenderKeyboardDevice() |
42 : m_hookesc(false) | 43 : m_hookesc(false) |
43 { | 44 { |
44 | 45 |
45 } | 46 } |
46 KX_BlenderKeyboardDevice::~KX_BlenderKeyboardDevice() | 47 KX_BlenderKeyboardDevice::~KX_BlenderKeyboardDevice() |
47 { | 48 { |
48 | 49 |
49 } | 50 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // convert event | 101 // convert event |
101 KX_EnumInputs kxevent = this->ToNative(incode); | 102 KX_EnumInputs kxevent = this->ToNative(incode); |
102 | 103 |
103 // only process it, if it's a key | 104 // only process it, if it's a key |
104 if (kxevent >= KX_BEGINKEY && kxevent <= KX_ENDKEY) | 105 if (kxevent >= KX_BEGINKEY && kxevent <= KX_ENDKEY) |
105 { | 106 { |
106 int previousTable = 1-m_currentTable; | 107 int previousTable = 1-m_currentTable; |
107 | 108 |
108 if (val == KM_PRESS) | 109 if (val == KM_PRESS) |
109 { | 110 { |
110 » » » if (kxevent == KX_ESCKEY && val != 0 && !m_hookesc) | 111 » » » if (kxevent == KX_KetsjiEngine::GetExitKey() && val != 0
&& !m_hookesc) |
111 result = true; | 112 result = true; |
112 if (kxevent == KX_PAUSEKEY && val && (IsPressed(KX_LEFTC
TRLKEY) || IsPressed(KX_RIGHTCTRLKEY))) | 113 if (kxevent == KX_PAUSEKEY && val && (IsPressed(KX_LEFTC
TRLKEY) || IsPressed(KX_RIGHTCTRLKEY))) |
113 result = true; | 114 result = true; |
114 | 115 |
115 // todo: convert val ?? | 116 // todo: convert val ?? |
116 m_eventStatusTables[m_currentTable][kxevent].m_eventval
= val ; //??? | 117 m_eventStatusTables[m_currentTable][kxevent].m_eventval
= val ; //??? |
117 | 118 |
118 switch (m_eventStatusTables[previousTable][kxevent].m_st
atus) | 119 switch (m_eventStatusTables[previousTable][kxevent].m_st
atus) |
119 { | 120 { |
120 case SCA_InputEvent::KX_JUSTACTIVATED: | 121 case SCA_InputEvent::KX_JUSTACTIVATED: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 162 } |
162 } | 163 } |
163 } | 164 } |
164 return result; | 165 return result; |
165 } | 166 } |
166 | 167 |
167 void KX_BlenderKeyboardDevice::HookEscape() | 168 void KX_BlenderKeyboardDevice::HookEscape() |
168 { | 169 { |
169 m_hookesc = true; | 170 m_hookesc = true; |
170 } | 171 } |
OLD | NEW |