Results 1 to 3 of 3

Thread: how to catch Shift + Left arrow? [Soved]

  1. #1
    Join Date
    Nov 2006
    Posts
    86
    Thanks
    6
    Thanked 14 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default how to catch Shift + Left arrow? [Soved]

    How in the world do I catch a keypress event for when the user presses Shift + left arrow?

    Paul
    Last edited by thomaspu; 28th December 2007 at 23:17. Reason: solved

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to catch Shift + Left arrow?

    Override keyPressEvent for your widget and test for:
    Qt Code:
    1. if (keyEvent->modifiers().testFlag(Qt::ShiftModifier) && keyEvent->key() == Qt::Key_Left)
    2. {
    3. ...
    4. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Nov 2006
    Posts
    86
    Thanks
    6
    Thanked 14 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to catch Shift + Left arrow?

    Ah, thanks, that did the trick!

    Paul

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.