Committing patch [#31704] "Patch to fix keyboard sensor from blocking quit game key...
[blender.git] / source / gameengine / GameLogic / SCA_KeyboardSensor.cpp
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();