Determining that Caps Lock is on
Is there a way to determine that Caps Lock is on? It is possible for the caps lock to be on before starting the app so I cannot rely on key events. I had hoped there was a way to query the state of Qt::Key_CapsLock but I don't see one.
For those familiar to wxWidgets, this would be like asking wxGetKeyState on the caps lock key.
Re: Determining that Caps Lock is on
There is QApplication::keyboardModifiers(), but I think it has the same problem.
Re: Determining that Caps Lock is on
It seems you can only detect if the CapsLock is pressed or release in QKeyEvent::key()
But you can always control the text input with QKeyEvent::text() when you need it. if Key_A is pressed, return QString will contain "A" or "a" according to Caps Lock state.
Re: Determining that Caps Lock is on
I shouldn't try making something up at night -.- {removed useless idea}
Re: Determining that Caps Lock is on
The good new (for me) is that I need this on windows. The bad news is that the official verdict is that there is no way to do this in qt (if the caps lock was turned on before the app was started).
I am going to have to rely on:
bool capsLogon = (bool)GetAsyncKeyState(VK_CAPITAL);