mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
sdl2 mouse wheel scrolling rev1
This commit is contained in:
parent
b24bdfbc8b
commit
06f6819d63
3 changed files with 19 additions and 0 deletions
|
|
@ -432,6 +432,11 @@ void PlatformWindowSDL::_triggerMouseLocationNotify(const SDL_Event& evt)
|
||||||
mouseEvent.trigger(getWindowId(), 0, evt.motion.xrel, evt.motion.yrel, true);
|
mouseEvent.trigger(getWindowId(), 0, evt.motion.xrel, evt.motion.yrel, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlatformWindowSDL::_triggerMouseWheelNotify(const SDL_Event& evt)
|
||||||
|
{
|
||||||
|
mouseEvent.trigger(getWindowId(), 0, evt.wheel.y, evt.wheel.y, false);
|
||||||
|
}
|
||||||
|
|
||||||
void PlatformWindowSDL::_triggerMouseButtonNotify(const SDL_Event& event)
|
void PlatformWindowSDL::_triggerMouseButtonNotify(const SDL_Event& event)
|
||||||
{
|
{
|
||||||
S32 action = (event.type == SDL_MOUSEBUTTONDOWN) ? SI_MAKE : SI_BREAK;
|
S32 action = (event.type == SDL_MOUSEBUTTONDOWN) ? SI_MAKE : SI_BREAK;
|
||||||
|
|
@ -536,6 +541,11 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SDL_MOUSEWHEEL:
|
||||||
|
{
|
||||||
|
_triggerMouseWheelNotify(evt);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ private:
|
||||||
void _processSDLEvent(SDL_Event &evt);
|
void _processSDLEvent(SDL_Event &evt);
|
||||||
void _triggerMouseLocationNotify(const SDL_Event& evt);
|
void _triggerMouseLocationNotify(const SDL_Event& evt);
|
||||||
void _triggerMouseButtonNotify(const SDL_Event& event);
|
void _triggerMouseButtonNotify(const SDL_Event& event);
|
||||||
|
void _triggerMouseWheelNotify(const SDL_Event& event);
|
||||||
void _triggerKeyNotify(const SDL_Event& event);
|
void _triggerKeyNotify(const SDL_Event& event);
|
||||||
void _triggerTextNotify(const SDL_Event& event);
|
void _triggerTextNotify(const SDL_Event& event);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,14 @@ void PlatformWindowManagerSDL::_process()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SDL_MOUSEWHEEL:
|
||||||
|
{
|
||||||
|
PlatformWindowSDL *window = mWindowMap[evt.wheel.windowID];
|
||||||
|
if (window)
|
||||||
|
window->_processSDLEvent(evt);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue