BGE: Fix Keyboard actuator that didn't generate release event.
authorBenoit Bolsee <benoit.bolsee@online.be>
Sat, 25 Jul 2009 12:35:14 +0000 (12:35 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Sat, 25 Jul 2009 12:35:14 +0000 (12:35 +0000)
source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp

index 7da4b9efb6892ac96481fe80a9bca4c61433aa53..32391e6326438b3ed15f6e9adb7c998041451b8b 100644 (file)
@@ -36,6 +36,7 @@
 #include <map>
 
 #include "wm_event_types.h"
+#include "WM_types.h"
 #include "SCA_IInputDevice.h"
 
 
index 877a0d39acfebe2e7046d4fff823c5f52f68c6dd..58af94854e6cf47508ca721bf1ca8b26445e7c1e 100644 (file)
@@ -104,7 +104,7 @@ bool        KX_BlenderKeyboardDevice::ConvertBlenderEvent(unsigned short incode,short v
        {
                int previousTable = 1-m_currentTable;
 
-               if (val > 0)
+               if (val == KM_PRESS)
                {
                        if (kxevent == KX_ESCKEY && val != 0 && !m_hookesc)
                                result = true;
@@ -138,7 +138,7 @@ bool        KX_BlenderKeyboardDevice::ConvertBlenderEvent(unsigned short incode,short v
                                }
                        }
                        
-               } else
+               } else if (val == KM_RELEASE)
                {
                        // blender eventval == 0
                        switch (m_eventStatusTables[previousTable][kxevent].m_status)