1
0
Fork 0

include/Spectre/Input/InputEvent.h: Move MouseButton::Type to Mouse class.

This commit is contained in:
Henrik Hautakoski 2020-01-24 17:23:44 +01:00
parent b2ca926a00
commit 762d26f368
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745
5 changed files with 35 additions and 37 deletions

View file

@ -4,22 +4,10 @@
#include <string>
#include <vector>
#include <Spectre/Input/Mouse.h>
namespace sp {
namespace MouseButton {
enum Type {
Unknown,
Left,
Right,
Middle,
Button1,
Button2,
NUM_MBUTTONS,
};
};
namespace Key {
enum Type {
@ -130,7 +118,7 @@ typedef struct InputEvent
};
struct MouseButtonEvent {
MouseButton::Type button;
Mouse::Button button;
bool pressed; /* true if pressed, false if released. */
std::string getName() const;

View file

@ -4,13 +4,23 @@
#include <string>
#include <Spectre/Math/Vector2.h>
#include "InputEvent.h"
#include "InputDevice.h"
namespace sp {
class Mouse : public InputDevice
{
public :
enum Button {
Unknown,
Left,
Right,
Middle,
Button1,
Button2,
NUM_MBUTTONS
};
public :
virtual ~Mouse();
@ -19,11 +29,11 @@ public :
//virtual Vector2i getPositionAbs() const = 0;
virtual bool isButtonDown(MouseButton::Type button) const = 0;
virtual bool isButtonDown(Button button) const = 0;
static std::string getButtonName(MouseButton::Type button);
static std::string getButtonName(Button button);
};
} // namespace sp
}; // namespace sp
#endif /* SPECTRE_INPUT_MOUSE_H */