1
System / No MouseButtonPressed/Released events with QSFMLCanvas
« on: April 18, 2011, 09:16:02 am »
Alright. I mucked about a bit and found out that I can get the missing events by adding these virtual function overrides to my canvas class:
Is there any sensible way I could modify QSFMLCanvas to catch these and add them into the SFML event queue? I notice that the event queue is managed by the sf::priv::WindowImpl class which is opaque to clients of the library, so it would appear that I'd have to modify the library itself for this, but maybe I'm missing something.
Code: [Select]
void mousePressEvent(QMouseEvent* event) {
std::cout << "mouse down" << std::endl;
}
void mouseReleaseEvent(QMouseEvent* event) {
std::cout << "mouse up" << std::endl;
}
Is there any sensible way I could modify QSFMLCanvas to catch these and add them into the SFML event queue? I notice that the event queue is managed by the sf::priv::WindowImpl class which is opaque to clients of the library, so it would appear that I'd have to modify the library itself for this, but maybe I'm missing something.