mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 23:24:41 +00:00
Merge pull request #1770 from Areloch/SDLMouseModsFix
Makes sure the key modifiers are passed along with mouse actions.
This commit is contained in:
commit
3432fbcd7a
1 changed files with 6 additions and 3 deletions
|
|
@ -426,16 +426,19 @@ void PlatformWindowSDL::defaultRender()
|
||||||
|
|
||||||
void PlatformWindowSDL::_triggerMouseLocationNotify(const SDL_Event& evt)
|
void PlatformWindowSDL::_triggerMouseLocationNotify(const SDL_Event& evt)
|
||||||
{
|
{
|
||||||
|
U32 mods = getTorqueModFromSDL(SDL_GetModState());
|
||||||
|
|
||||||
if(!mMouseLocked)
|
if(!mMouseLocked)
|
||||||
mouseEvent.trigger(getWindowId(), 0, evt.motion.x, evt.motion.y, false);
|
mouseEvent.trigger(getWindowId(), mods, evt.motion.x, evt.motion.y, false);
|
||||||
else
|
else
|
||||||
mouseEvent.trigger(getWindowId(), 0, evt.motion.xrel, evt.motion.yrel, true);
|
mouseEvent.trigger(getWindowId(), mods, evt.motion.xrel, evt.motion.yrel, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlatformWindowSDL::_triggerMouseWheelNotify(const SDL_Event& evt)
|
void PlatformWindowSDL::_triggerMouseWheelNotify(const SDL_Event& evt)
|
||||||
{
|
{
|
||||||
|
U32 mods = getTorqueModFromSDL(SDL_GetModState());
|
||||||
S32 wheelDelta = Con::getIntVariable("$pref::Input::MouseWheelSpeed", 120);
|
S32 wheelDelta = Con::getIntVariable("$pref::Input::MouseWheelSpeed", 120);
|
||||||
wheelEvent.trigger(getWindowId(), 0, evt.wheel.x * wheelDelta, evt.wheel.y * wheelDelta);
|
wheelEvent.trigger(getWindowId(), mods, evt.wheel.x * wheelDelta, evt.wheel.y * wheelDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlatformWindowSDL::_triggerMouseButtonNotify(const SDL_Event& event)
|
void PlatformWindowSDL::_triggerMouseButtonNotify(const SDL_Event& event)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue