diff options
-rw-r--r-- | source/gameengine/Converter/KX_ConvertSensors.cpp | 3 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 5 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_KeyboardSensor.h | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index fa9eb5317b9..2bd1688ca6d 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -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); } diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index b39ae209d67..5bdf2e96e93 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -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(); diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 8e21d6bfde1..778929a2551 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -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(); |