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)

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 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
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on 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 last edited by
        #3

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

        1 Reply Last reply
        0

        • Login

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