View Full Version : Detect shift/cntrl/alt without event

3rd May 2013, 17:06
WHat's the right way to detect whether the modifier-keys are currently down or not?

I am implementing a custom scroll area, and how i scroll changes depending on whether these keys are up or down.

For scrolling, i connect to the actionTriggered(int) signal of the scrollbar and adjust its position accordingly.
But that way i do not get passed a Q*Event, and thus no modifiers() to check.

Monitoring key events doesnt seem to be an option.


Santosh Reddy
3rd May 2013, 17:21
Use QApplication::keyboardModifiers()