Key pressed in QWidget::mousePressedEvent()
-
Is there any way that let me know if the spacebar is being pressed inside QWidget::mousePressEvent() / QWidget::mouseMoveEvent() ?
Not to my knowledge, no. But you can intercept the key-press event as well as the mouse event and set a state internally that the spacebar is pressed.
Anyway, I now use Win32 API -- GetKeyState() / GetAsyncKeyState() to solve the problem.
That's possible, but the implications would be you code will be working only(!) on windows and you would require the windows SDKs to build it.
Kind regards.
-
@kshegunov said:
Not to my knowledge, no. But you can intercept the key-press event as well as the mouse event and set a state internally that the spacebar is pressed.
Good Advice. I may try it... But I should stop programming now and get back to my real hobby -- 3DCG. ( Programming isn't even my hobby, I just need some app that's tailor-made for myself.