diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-03 03:45:03 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-03 03:45:03 +0400 |
commit | 08c14c7ca0398d792e3a2676b1afd66666674dae (patch) | |
tree | ca57b8c1d929031f4290da7d94a14ec502001918 /source/gameengine/GameLogic | |
parent | 45a240260e5545a2fe04121f76cb7c10982cf123 (diff) |
Mouse Wheel Support for the Game Engine.
This adds "Wheel Up" and "Wheel Down" as choices to the Mouse sensor brick.
Diffstat (limited to 'source/gameengine/GameLogic')
-rw-r--r-- | source/gameengine/GameLogic/SCA_IInputDevice.h | 3 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_MouseSensor.cpp | 8 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_MouseSensor.h | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_IInputDevice.h b/source/gameengine/GameLogic/SCA_IInputDevice.h index ff74ac91b13..b2ed8686b43 100644 --- a/source/gameengine/GameLogic/SCA_IInputDevice.h +++ b/source/gameengine/GameLogic/SCA_IInputDevice.h @@ -248,6 +248,9 @@ public: KX_RIGHTMOUSE, KX_ENDMOUSEBUTTONS, + + KX_WHEELUPMOUSE, + KX_WHEELDOWNMOUSE, KX_MOUSEX, KX_MOUSEY, diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 2c4b7d87c30..08cf68ba332 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -73,6 +73,12 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr, case KX_MOUSESENSORMODE_RIGHTBUTTON: m_hotkey = SCA_IInputDevice::KX_RIGHTMOUSE; break; + case KX_MOUSESENSORMODE_WHEELUP: + m_hotkey = SCA_IInputDevice::KX_WHEELUPMOUSE; + break; + case KX_MOUSESENSORMODE_WHEELDOWN: + m_hotkey = SCA_IInputDevice::KX_WHEELDOWNMOUSE; + break; default: ; /* ignore, no hotkey */ } @@ -141,6 +147,8 @@ bool SCA_MouseSensor::Evaluate(CValue* event) case KX_MOUSESENSORMODE_LEFTBUTTON: case KX_MOUSESENSORMODE_MIDDLEBUTTON: case KX_MOUSESENSORMODE_RIGHTBUTTON: + case KX_MOUSESENSORMODE_WHEELUP: + case KX_MOUSESENSORMODE_WHEELDOWN: { const SCA_InputEvent& event = mousedev->GetEventValue(m_hotkey); if (event.m_status == SCA_InputEvent::KX_JUSTACTIVATED) diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index 5923b1e6b8c..9b8043a1f15 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -79,6 +79,8 @@ class SCA_MouseSensor : public SCA_ISensor KX_MOUSESENSORMODE_LEFTBUTTON, KX_MOUSESENSORMODE_MIDDLEBUTTON, KX_MOUSESENSORMODE_RIGHTBUTTON, + KX_MOUSESENSORMODE_WHEELUP, + KX_MOUSESENSORMODE_WHEELDOWN, KX_MOUSESENSORMODE_POSITION, KX_MOUSESENSORMODE_POSITIONX, KX_MOUSESENSORMODE_POSITIONY, |