diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-06-10 23:32:57 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-06-10 23:32:57 +0400 |
commit | 298feff39006c14aa28b5e0232aa7ed70a83a496 (patch) | |
tree | 652508be018e15344ccb69ab964d7b9acb622faa /source | |
parent | 88748904c68e88a2c5864a248419f7fad960695d (diff) |
Committing patch [#31704] "Patch to fix keyboard sensor from blocking quit game key binding" by Jay Parker. This patch fixes [#31671] "Keyboard Sensor blocks Quit Game Key Binding"
Diffstat (limited to 'source')
-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(); |