This commit is contained in:
Jorijn van der Graaf 2025-11-10 20:25:50 +01:00
commit 2254ad53c5
11 changed files with 300 additions and 466 deletions

View file

@ -44,30 +44,36 @@ export namespace Crafter {
bool ctrlKey;
bool shiftKey;
bool metaKey;
MouseEvent(double clientX, double clientY, double screenX, double screenY, std::uint_fast32_t button, std::uint_fast32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) : clientX(clientX), clientY(clientY), screenX(screenX), screenY(screenY), button(button), buttons(buttons), altKey(altKey), ctrlKey(ctrlKey), shiftKey(shiftKey), metaKey(metaKey) {}
};
struct InputEvent {
std::string data;
bool isComposing;
InputEvent(const char* data, bool isComposing) : data(data), isComposing(isComposing) {}
};
struct WheelEvent : public MouseEvent {
double deltaX;
double deltaY;
double deltaZ;
WheelEvent(double clientX, double clientY, double screenX, double screenY, std::uint_fast32_t button, std::uint_fast32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey, double deltaX, double deltaY, double deltaZ): MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey), deltaX(deltaX), deltaY(deltaY), deltaZ(deltaZ) {}
};
struct ResizeEvent {
std::uint_fast32_t width;
std::uint_fast32_t height;
ResizeEvent(std::uint_fast32_t width, std::uint_fast32_t height) : width(width), height(height) {}
};
struct ScrollEvent {
double scrollX;
double scrollY;
ScrollEvent(double scrollX, double scrollY) : scrollX(scrollX), scrollY(scrollY) {}
};
struct ChangeEvent {
std::string value;
ChangeEvent(const char* value) : value(value) {}
};
}