Results 1 to 3 of 3

Thread: multiple key combo event

  1. #1
    Join Date
    Jun 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default multiple key combo event

    Hi,

    I'd like to react to multi-key combos (e.g. Key_Q+Key_W) that are being held down. So when you hold down a key combo, the event should be called all the time, just the same way as it works with single key events. I tried to use QShortcuts and enable autorepeat for them, but that didn't work:
    Qt Code:
    1. keyCombos_.push_back(new QShortcut(QKeySequence(Qt::Key_W, Qt::Key_D), this));
    2. connect(keyCombos_[0], SIGNAL(activated()), SLOT(keySequenceEvent_WD()));
    3. setShortcutAutoRepeat(keyCombos_[0]->id(), true);
    To copy to clipboard, switch view to plain text mode 
    When using this approach I also have the problem that I can't catch single Key_W (or whatever the first Key in the keysequence is) strokes anymore.

    Btw is there a way to remove the waiting time before a key is autorepeated?

    Thanks,
    Thomas

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: multiple key combo event

    QAbstractButton::setAutoRepeatInterval

  3. #3
    Join Date
    Jun 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: multiple key combo event

    This would be the functionality that I'm looking for, but I'm not using buttons, I'm using key events and key sequences.

    Thanks,
    Thomas

Similar Threads

  1. Replies: 1
    Last Post: 29th June 2010, 17:59
  2. Replies: 0
    Last Post: 4th May 2010, 07:49
  3. inserting combo box in table ..
    By wagmare in forum Qt Programming
    Replies: 3
    Last Post: 2nd June 2009, 07:42
  4. QProcess Bash in Event Filter (Multiple Processes)
    By Arsenic in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2008, 08:42
  5. DropDown combo box
    By Tavit in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2008, 08:40

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.