Results 1 to 5 of 5

Thread: handle a Alt+E key press

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default handle a Alt+E key press

    In the keyPressEvent function, how do I see if the user pressed Alt+e (or Alt+E) ?

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: handle a Alt+E key press

    First catching - user press ALT, second catching - user press E
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: handle a Alt+E key press

    Ah, solved it now. There are two QKeyEvents generated and with a bool flag it is solved.
    Last edited by Morea; 9th September 2006 at 11:24. Reason: solved.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: handle a Alt+E key press

    You can also use QShortcut.

  5. #5
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: handle a Alt+E key press

    Quote Originally Posted by zlatko
    First catching - user press ALT, second catching - user press E
    AFAIK Alt isn't recognized as a key but as a modifier... see QKeyEvent::modifiers()
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. Replies: 17
    Last Post: 8th February 2007, 16:30
  2. Howto handle key-release with autorepeat key
    By gould75 in forum Qt Programming
    Replies: 2
    Last Post: 20th August 2006, 07:52
  3. Draw QtCanvasElipse on mouse press event position
    By YuriyRusinov in forum Newbie
    Replies: 1
    Last Post: 31st May 2006, 11:57
  4. QTextEdit and "Enter" press
    By krivenok in forum Qt Programming
    Replies: 2
    Last Post: 28th March 2006, 12:10
  5. New thread to handle paintEvent
    By bitChanger in forum Qt Programming
    Replies: 1
    Last Post: 9th March 2006, 21:41

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.