Handle press and release with QShortcut



  • Dear all,
    I would like to associate an action when PAGE_DOWN is press and stop this action when it is released.

    I used to do this my re-implementing the keyPressedEvent() but I discovered the QShortcut object and thought I could give it a try.
    I successfully binded a slot to my shortcut, however the only signal I have is acrivated().
    I there a way to handle pressed and released modes?

    Thanks a zillion!



  • QShortcut does not provide signals that differentiate between a press and a release, you will need to use keyPressEvent() and keyReleaseEvent() to get this distinction.



  • Ok, thanks for the answer.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.