Committing patch [#31704] "Patch to fix keyboard sensor from blocking quit game key...
authorMitchell Stokes <mogurijin@gmail.com>
Sun, 10 Jun 2012 19:32:57 +0000 (19:32 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Sun, 10 Jun 2012 19:32:57 +0000 (19:32 +0000)
source/gameengine/Converter/KX_ConvertSensors.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.h

index fa9eb5317b945f319bb01622f8d98783c53d076c..2bd1688ca6dc3b0861678fa6ab071440d6ddf470 100644 (file)
@@ -302,7 +302,8 @@ void BL_ConvertSensors(struct Object* blenderobject,
                                                (blenderkeybdsensor->type == SENS_ALL_KEYS),
                                                blenderkeybdsensor->targetName,
                                                blenderkeybdsensor->toggleName,
-                                               gameobj); //                    blenderkeybdsensor->pad);
+                                               gameobj,
+                                               KX_KetsjiEngine::GetExitKey()); //                      blenderkeybdsensor->pad);
                                        
                                } 
                                
index b39ae209d676f4bf5fe61174d267a03e18bbd028..5bdf2e96e93425f9e2c9f2c78cdb3f8cbf1e3b40 100644 (file)
@@ -54,7 +54,8 @@ SCA_KeyboardSensor::SCA_KeyboardSensor(SCA_KeyboardManager* keybdmgr,
                                                                           bool bAllKeys,
                                                                           const STR_String& targetProp,
                                                                           const STR_String& toggleProp,
-                                                                          SCA_IObject* gameobj)
+                                                                          SCA_IObject* gameobj,
+                                                                          short int exitKey)
        :SCA_ISensor(gameobj,keybdmgr),
         m_hotkey(hotkey),
         m_qual(qual),
@@ -63,7 +64,7 @@ SCA_KeyboardSensor::SCA_KeyboardSensor(SCA_KeyboardManager* keybdmgr,
         m_targetprop(targetProp),
         m_toggleprop(toggleProp)
 {
-       if (hotkey == SCA_IInputDevice::KX_ESCKEY)
+       if (hotkey == exitKey)
                keybdmgr->GetInputDevice()->HookEscape();
 //     SetDrawColor(0xff0000ff);
        Init();
index 8e21d6bfde1a67c620817e88d17578456875227d..778929a255121cced98ed0e605668db7ddc21af7 100644 (file)
@@ -94,7 +94,8 @@ public:
                                           bool bAllKeys,
                                           const STR_String& targetProp,
                                           const STR_String& toggleProp,
-                                          SCA_IObject* gameobj);
+                                          SCA_IObject* gameobj,
+                                          short int exitKey);
        virtual ~SCA_KeyboardSensor();
        virtual CValue* GetReplica();
        virtual void Init();