Support controller touchpads (Resolves https://gitlab.com/OpenMW/openmw/-/issues/6639)

This commit is contained in:
uramer 2022-02-21 19:49:00 +00:00 committed by Petr Mikheev
parent 7b8216a0e1
commit cc6dce5443
10 changed files with 207 additions and 83 deletions

View file

@ -146,6 +146,20 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> v
if(mConListener)
mConListener->axisMoved(1, evt.caxis);
break;
#if SDL_VERSION_ATLEAST(2, 0, 14)
case SDL_CONTROLLERSENSORUPDATE:
// controller sensor data is received on demand
break;
case SDL_CONTROLLERTOUCHPADDOWN:
mConListener->touchpadPressed(1, TouchEvent(evt.ctouchpad));
break;
case SDL_CONTROLLERTOUCHPADMOTION:
mConListener->touchpadMoved(1, TouchEvent(evt.ctouchpad));
break;
case SDL_CONTROLLERTOUCHPADUP:
mConListener->touchpadReleased(1, TouchEvent(evt.ctouchpad));
break;
#endif
case SDL_WINDOWEVENT:
handleWindowEvent(evt);
break;