1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-16 16:10:58 +00:00
OpenMW/apps/openmw/mwinput/mousemanager.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.6 KiB
C++
Raw Normal View History

#ifndef MWINPUT_MWMOUSEMANAGER_H
#define MWINPUT_MWMOUSEMANAGER_H
#include <components/sdlutil/events.hpp>
#include <components/settings/settings.hpp>
namespace SDLUtil
{
class InputWrapper;
}
namespace MWInput
{
class BindingsManager;
class MouseManager : public SDLUtil::MouseListener
{
public:
MouseManager(BindingsManager* bindingsManager, SDLUtil::InputWrapper* inputWrapper, SDL_Window* window);
virtual ~MouseManager() = default;
2020-05-26 07:24:47 +00:00
void updateCursorMode();
2020-05-26 06:58:24 +00:00
void update(float dt);
void mouseMoved(const SDLUtil::MouseMotionEvent& arg) override;
void mousePressed(const SDL_MouseButtonEvent& arg, Uint8 id) override;
void mouseReleased(const SDL_MouseButtonEvent& arg, Uint8 id) override;
void mouseWheelMoved(const SDL_MouseWheelEvent& arg) override;
bool injectMouseButtonPress(Uint8 button);
bool injectMouseButtonRelease(Uint8 button);
2020-07-01 05:52:57 +00:00
void injectMouseMove(float xMove, float yMove, float mouseWheelMove);
void warpMouse();
void setMouseLookEnabled(bool enabled) { mMouseLookEnabled = enabled; }
void setGuiCursorEnabled(bool enabled) { mGuiCursorEnabled = enabled; }
2021-06-26 21:10:24 +00:00
int getMouseMoveX() const { return mMouseMoveX; }
int getMouseMoveY() const { return mMouseMoveY; }
private:
BindingsManager* mBindingsManager;
SDLUtil::InputWrapper* mInputWrapper;
float mGuiCursorX;
float mGuiCursorY;
int mMouseWheel;
bool mMouseLookEnabled;
bool mGuiCursorEnabled;
2021-06-26 21:10:24 +00:00
int mMouseMoveX;
int mMouseMoveY;
};
}
#endif