mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-25 09:44:02 +00:00
34 lines
683 B
C++
34 lines
683 B
C++
#ifndef VIRTUALMOUSE_H
|
|
#define VIRTUALMOUSE_H
|
|
|
|
#include "ActionMapper.h"
|
|
|
|
class VirtualMouse : public ActionMapper
|
|
{
|
|
VirtualMouse();
|
|
|
|
struct Buttons
|
|
{
|
|
bool left, middle, right;
|
|
};
|
|
|
|
// externally set to actions that are to be handled as a button press
|
|
int actionToLeft, actionToRight;
|
|
|
|
// const references to keep the "API" for the rest of the code
|
|
// but make sure that nothing can be externally modified
|
|
const Buttons &buttons, &pure_buttons;
|
|
|
|
Vector position, lastPosition;
|
|
Vector change;
|
|
|
|
void update(float dt);
|
|
|
|
// override
|
|
virtual void action(int actionID, int state, int playerID, InputDeviceType device);
|
|
|
|
private:
|
|
Buttons _buttons, _pure_buttons;
|
|
};
|
|
|
|
#endif
|