Results 1 to 2 of 2

Thread: CTRL-+ in keyPressEvent

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default CTRL-+ in keyPressEvent

    Hi,

    I'm currently trying to react on pressing CTRL-+ (i.e. holding CTRL and pressing +) in a keyPressEvent.
    Unfortunately this doesn't work properly, since event->key() gives me two different key codes for the + key, depending on whether CTRL is pressed or not. If no CTRL is pressed, the correct key code (43) is given, otherwise I get the key code 93, which seems to be a closing bracket.
    I'm using a German keyboard layout, could that be a problem? Or what else am I doing wrong?

    Cheers,
    fallen

  2. #2
    Join Date
    Apr 2011
    Posts
    61
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: CTRL-+ in keyPressEvent

    If you're using windows you can try event->nativeKeyCode() == VK_ADD and you will get the numpad plus key.

Similar Threads

  1. keyPressEvent - "ctrl + tab" handle two time
    By somename in forum Qt Programming
    Replies: 7
    Last Post: 30th May 2010, 20:29
  2. filterout the Alt+Ctrl+Del
    By sudhansu in forum Qt Programming
    Replies: 6
    Last Post: 25th March 2010, 07:55
  3. Keypressevent - CTRL Key_Enter
    By qtuser20 in forum Qt Programming
    Replies: 2
    Last Post: 3rd March 2010, 20:47
  4. disable ALT+CTRL+DEL!!!!
    By phillip_Qt in forum Qt Programming
    Replies: 10
    Last Post: 3rd November 2009, 09:23
  5. CTrl + A
    By navi1084 in forum Qt Programming
    Replies: 1
    Last Post: 23rd October 2008, 09:19

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.