Add infrastructure for mouse events

This commit is contained in:
Lorenzooone
2024-04-26 19:41:06 +02:00
parent 54ef5f52fd
commit 875d5e2661
4 changed files with 22 additions and 11 deletions

View File

@@ -517,7 +517,13 @@ void WindowScreen::poll_window() {
joystickId = event.joystickButton.joystickId;
else if(event.type == sf::Event::JoystickMoved)
joystickId = event.joystickMove.joystickId;
events_queue.emplace(event.type, event.key.code, event.text.unicode, joystickId, event.joystickButton.button, event.joystickMove.axis, event.joystickMove.position);
int mouse_x = event.mouseButton.x;
int mouse_y = event.mouseButton.y;
if(event.type == sf::Event::MouseMoved) {
mouse_x = event.mouseMove.x;
mouse_y = event.mouseMove.y;
}
events_queue.emplace(event.type, event.key.code, event.text.unicode, joystickId, event.joystickButton.button, event.joystickMove.axis, event.joystickMove.position, event.mouseButton.button, mouse_x, mouse_y);
}
this->events_access->unlock();
}