refactor: replace references to Events with Input

This commit is contained in:
MihailRis
2025-04-02 14:55:53 +03:00
parent 4c48afbb90
commit b202d1455b
15 changed files with 160 additions and 116 deletions
+7 -3
View File
@@ -178,10 +178,10 @@ void GUI::actFocused() {
focus = nullptr;
return;
}
for (auto codepoint : Events::codepoints) {
for (auto codepoint : input.getCodepoints()) {
focus->typed(codepoint);
}
for (auto key : Events::pressedKeys) {
for (auto key : input.getPressedKeys()) {
focus->keyPressed(key);
}
@@ -205,7 +205,7 @@ void GUI::act(float delta, const Viewport& vp) {
updateTooltip(delta);
const auto& cursor = input.getCursor();
if (!Events::isCursorLocked()) {
if (!cursor.locked) {
actMouse(delta, cursor);
} else {
if (hover) {
@@ -357,3 +357,7 @@ void GUI::toggleDebug() {
const Input& GUI::getInput() const {
return engine.getInput();
}
Input& GUI::getInput() {
return engine.getInput();
}