Important: Please read the Qt Code of Conduct -

Help with QAbstractNativeEventFilter

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



    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


    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