View Full Version : How to determine when caplock key is turned ON?

9th October 2009, 10:36

I am using linux ( fedora 8 ) . I need to determine whenevr Capslock is turned ON i need to capture this signal and prompt to user.
Can anybody please suggest how to achieve this?


9th October 2009, 11:09
Listen to the key press event.

You can override the mehod in a derived widget QWidget::keyPressEvent(QKeyEvent*) and check for Qt::Key_CapsLock in QKeyEvent::key().

There are other way to catch event according to your desing, like installing an event filter and filter the event you want with QObject::installEventFilter()

But knowing if the capslock is on without user input is still a mystery for me.