Problem with QKeyEvent and multi key press



  • 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)){
    //............
    }
    }



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

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

    means

    @
    Key_O ==Key_i
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.