Help with QAbstractNativeEventFilter



  • my code
    @bool MyEventFilter::nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pResult)
    {
    const MSG &msg = *static_cast<MSG *>(pMessage);
    switch(msg.wParam)
    {
    case Qt::Key_0:
    qDebug() << "START GAME";
    Click(560,580);
    break;

           }
    

    }

    @
    its call function Click() while i hold key 0 on keyboard, i want catch only keypress for that Click call only ONCE
    how to?


  • Lifetime Qt Champion

    Hi,

    Why not use just use QWidget::event ( QEvent * event ) ? Using the native event filter looks like an overkill for your use case.

    If I understand you correctly, you want to handle the press of 0 once while holding down a mouse button ?


Log in to reply
 

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