hostevents: dispatch mouse button events.

This commit is contained in:
Maxim Poliakovski 2023-08-01 23:57:16 +02:00
parent 5b90a3e21d
commit b4b41a47b2
2 changed files with 17 additions and 0 deletions

View File

@ -63,6 +63,22 @@ void EventManager::poll_events()
}
break;
case SDL_MOUSEBUTTONDOWN: {
MouseEvent me;
me.buttons_state = 1;
me.flags = MOUSE_EVENT_BUTTON;
this->_mouse_signal.emit(me);
}
break;
case SDL_MOUSEBUTTONUP: {
MouseEvent me;
me.buttons_state = 0;
me.flags = MOUSE_EVENT_BUTTON;
this->_mouse_signal.emit(me);
}
break;
default:
unhandled_events++;
}

View File

@ -48,6 +48,7 @@ public:
uint32_t flags;
uint32_t xrel;
uint32_t yrel;
uint8_t buttons_state;
};
class EventManager {