Results 1 to 2 of 2

Thread: How to determine when caplock key is turned ON?

  1. #1
    Join Date
    May 2009
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to determine when caplock key is turned ON?

    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

  2. #2
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to determine when caplock key is turned ON?

    Listen to the key press event.

    You can override the mehod in a derived widget QWidget::keyPressEvent(QKeyEvent*) and check for Qt::Key_CapsLockin 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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.