Trackpad event Mac distance from 2 Finger to zoom in or out depend finger direction...



  • 9 years a go i have found a trackpad event to exact know the distance from 2 finger..
    I can not find this event from mac trackpad distance ..
    have anybody made so one?

    Now i have only controll Key_Up & down at moment... is a QAbstractScrollArea to play document & pdf e select text..

    /*   Qt::Key_Down	0x01000015
    Qt::Key_PageUp	0x01000016  Qt::Key_Control
    Qt::Key_PageDown */
    void DrawDoument::keyPressEvent(QKeyEvent * e) {
      bool CONTROLLACTIVE, savekey = false;
    
       if (Qt::Key_Meta == e->key() ||
                     Qt::Key_Control == e->key() ||
                     Qt::Key_Escape == e->key() ) { /// window & mac || Qt::Key_Up == e->key()  || Qt::Key_Down == e->key()
          lastkeyMETA = true;  /// reset on keyReleaseEvent
           if (Beeboncontroll) {
            QApplication::beep();
           }
        }
        //// qDebug() <<  __FUNCTION__ << " - e->key()" << e->key() << " lastkeyMETA:" << lastkeyMETA;
        if (lastkeyMETA) {
             if (Qt::Key_PageUp == e->key() ) {
                    //// qDebug() <<  "salire su page scroll";
                    e->accept();
                    emit newdata();
                    return;
              } else
               if (Qt::Key_PageDown == e->key() ) {
                    //// qDebug() <<  "giuuu page scroll ";
                    e->accept();
                    emit newdata();
                    return;
              } else
                if (Qt::Key_Up == e->key() ) {
                    scaleFaktor = scaleFaktor + 0.05;
                    if (scaleFaktor < 0.22 || scaleFaktor > 10) {
                     scaleFaktor =9.9;
                    }
                    emit newdata();
                    e->accept();
                    return;
              } else
                if (Qt::Key_Down == e->key()) {
                    scaleFaktor = scaleFaktor - 0.05;
                    if (scaleFaktor < 0.22 || scaleFaktor > 10) {
                     scaleFaktor =0.23;
                    }
                    emit newdata();
                    e->accept();
                    return;
                }
             }
            if (Qt::Key_Home == e->key()) {
              qDebug() <<  "Qt::Key_Home";
            }
            e->accept();
            //// qDebug() <<  __FUNCTION__ << " ende - e->isAutoRepeat()" << e->isAutoRepeat();
    }
    
    

Log in to reply
 

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