Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Catch key combination (TAB + arrow up/down)
Forum Update on Monday, May 27th 2025

Catch key combination (TAB + arrow up/down)

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 1 Offline
    1 Offline
    169Martin
    wrote on 23 Jul 2014, 13:44 last edited by
    #1

    Hi, i need to catch event for TAB + arrow up/down...as i know, it is only possible with modifiers + key.

    Is there some way for archieve this? I want to implement catch of event where user presses first arrow up/down and then TAB key ... i want to emit signal when in the moment arrow up/down and tab key are pressed

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 23 Jul 2014, 14:19 last edited by
      #2

      There is not modifiers for this. You need to do normal programing practice for this. See if the following can help.

      @void MyWidget::keyPressEvent(QKeyEvent *kevt){
      qDebug() << "Key Press Event Happend =" << kevt->text();
      if (kevt->key() == Qt::Key_Up && prevKey == Qt::Key_Tab){
      qDebug() << "Up key and Tab"<<endl;
      }
      prevKey = kevt->key();
      return;
      }@

      It works for the first time. You need to check autorepeat. If user checks keeps the up arrow in pressed state, this logic may fail. You need to add additional logic to this.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • 1 Offline
        1 Offline
        169Martin
        wrote on 24 Jul 2014, 11:21 last edited by
        #3

        yep, its usable. thanks for your time and wisdom! peace :)

        1 Reply Last reply
        0

        1/3

        23 Jul 2014, 13:44

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved