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

28
events/keyEvent.h Normal file
View File

@@ -0,0 +1,28 @@
#include "terminal.h"
#include "event.h"
class KeyEvent : public Event {
const int key;
const int scancode;
const int mod;
const int repeat;
const bool pressed;
public:
KeyEvent(int, int, int, int, bool);
inline int getKey() const { return key; }
inline int getScancode() const { return scancode; }
inline int getMod() const { return mod; }
inline bool getPressed() const { return pressed; }
EventType getType() const { return pressed ? EventType::KeyPressed : EventType::KeyReleased; }
};
class KeyTypedEvent : public Event {
const std::string text;
const int windowID;
public:
KeyTypedEvent(int, char*);
inline int getWindowID() const { return windowID; }
inline const char* getText() const { return text.c_str(); }
EventType getType() const { return EventType::KeyTyped; }
};