Results 1 to 14 of 14

Thread: i need to use Alt+Ctrl+arrow keys combination

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Jun 2013
    Location
    Bangalore
    Posts
    27
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    7

    Default Re: i need to use Alt+Ctrl+arrow keys combination

    windows 64-bit and Qt version is 4.8.5, i am using VS2010 by adding Qt plugin


    Qt Code:
    1. void CBoxViewItem::keyPressEvent(QKeyEvent* f_event)
    2. {
    3. if(f_event->KeyPress)
    4. {
    5. if(f_event->type() == QEvent::KeyPress)
    6. {
    7. if(f_event->modifiers().testFlag(Qt::AltModifier) && f_event->modifiers().testFlag(Qt::ControlModifier).)
    8. {
    9. switch(f_event->key())
    10. {
    11. case Qt::Key_Left:
    12. qDebug()<<"Alt + Ctrl + Key_Left";
    13. break;
    14. case Qt::Key_Up:
    15. qDebug()<<"Alt + Ctrl + Key_Up";
    16. break;
    17. case Qt::Key_Right:
    18. qDebug()<<"Alt + Ctrl + Key_Right";
    19. break;
    20. case Qt::Key_Down:
    21. qDebug()<<"Alt + Ctrl + Key_Down";
    22. break;
    23. default:
    24. qDebug()<<"Use Only Arrow Keys";
    25. break;
    26. }
    27. }
    28. else
    29. qDebug()<<"Use Alt + Ctrl";
    30. }
    31. }
    32. }
    To copy to clipboard, switch view to plain text mode 

    this is always going to default case only.
    Last edited by high_flyer; 4th September 2013 at 11:24. Reason: code tags

Similar Threads

  1. Detect Arrow Keys
    By Ebonair in forum Qt Programming
    Replies: 4
    Last Post: 1st October 2010, 03:55
  2. Replies: 2
    Last Post: 4th August 2010, 20:10
  3. Replies: 5
    Last Post: 10th March 2010, 15:50
  4. Replies: 1
    Last Post: 6th July 2009, 13:48
  5. How can I associate arrow keys?
    By Mariane in forum Newbie
    Replies: 2
    Last Post: 20th January 2006, 18:31

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.