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. Problem with QKeyEvent and multi key press
Forum Updated to NodeBB v4.3 + New Features

Problem with QKeyEvent and multi key press

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.3k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    Jako87
    wrote on last edited by
    #1

    I would like to Know, How I could to use a multiple key press event?? I would like to activate some part of my program when i press "i" + "o", but I see in the reference that i only can make with special keys. Can someone help me???
    This don't works!!!

    mywidget::keypressevent(QKeyEvent *kevent)
    {
    if ((kevent->key()==Key_O)&&(kevent->key()==Key_i)){
    //............
    }
    }

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      As you can see, the logic of you code is wrong.

      @
      (kevent->key()==Key_O)&&(kevent->key()==Key_i)
      @

      means

      @
      Key_O ==Key_i
      @

      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