Files
Archimedes/events/keyEvent.h
2024-08-10 21:20:28 -05:00

28 lines
857 B
C++

#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; }
};