Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-05-02 00:43:18 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-05-02 00:43:18 +0400
commitd99ddc5cf8c308bf7c0a61c1c266776a313936fa (patch)
treec724668b20202a1d47dd3bb6975a622819c714fd /source/gameengine/GameLogic/SCA_MouseSensor.cpp
parent57b819301cba95357c421aee0e6b927a715ffb16 (diff)
Fix BGE bug #8863: Keyboard Sensor does not send negative pulse if key released while scene suspended. The fix covers keyboard and mouse sensor
Diffstat (limited to 'source/gameengine/GameLogic/SCA_MouseSensor.cpp')
-rw-r--r--source/gameengine/GameLogic/SCA_MouseSensor.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp
index a91cf3e0439..d8894ff593c 100644
--- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp
@@ -158,6 +158,23 @@ bool SCA_MouseSensor::Evaluate(CValue* event)
{
m_val = 0;
result = true;
+ } else
+ {
+ if (event.m_status == SCA_InputEvent::KX_ACTIVE)
+ {
+ if (m_val == 0)
+ {
+ m_val = 1;
+ result = true;
+ }
+ } else
+ {
+ if (m_val == 1)
+ {
+ m_val = 0;
+ result = true;
+ }
+ }
}
}
break;
@@ -183,6 +200,13 @@ bool SCA_MouseSensor::Evaluate(CValue* event)
{
m_val = 0;
result = true;
+ } else
+ {
+ if (m_val == 1)
+ {
+ m_val = 0;
+ result = true;
+ }
}
}
break;