Begin Repo

This commit is contained in:
2024-08-10 21:20:28 -05:00
commit 08115f90ce
41 changed files with 19581 additions and 0 deletions

33
events/mouseEvent.h Normal file
View File

@@ -0,0 +1,33 @@
#include "terminal.h"
#include "event.h"
class MouseButtonEvent : public Event {
const int button;
const bool pressed;
public:
MouseButtonEvent(int, bool);
inline int getButton() const { return button; }
inline bool getPressed() const { return pressed; }
EventType getType() const { return pressed ? EventType::MouseButtonPressed : EventType::MouseButtonReleased; }
};
class MouseMovedEvent : public Event {
const int x, y;
const double dx, dy;
public:
MouseMovedEvent(int, int, double, double);
inline int getX() const { return x; }
inline int getY() const { return y; }
inline double getDeltaX() const { return dx; }
inline double getDeltaY() const { return dy; }
EventType getType() const { return EventType::MouseMoved; }
};
class MouseScrolledEvent : public Event {
const int x, y;
public:
MouseScrolledEvent(int, int);
inline int getX() const { return x; }
inline int getY() const { return y; }
EventType getType() const { return EventType::MouseScrolled; }
};