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. #3
    Join Date
    Jun 2013
    Location
    Bangalore
    Posts
    27
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

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

    fine bro its working but the problem is as soon as i press Alt+Ctrl it going to default case (Use Only Arrow Keys), Alt+Ctrl+any arrow key it is going to default case only.

    i have done as below

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