PDA

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



AviMittal
9th October 2009, 09:36
Hi

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?

Thanx

scascio
9th October 2009, 10: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.