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. Trackpad event Mac distance from 2 Finger to zoom in or out depend finger direction...
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved Solved General and Desktop
1 Posts 1 Posters 456 Views
  • 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.
  • P Offline
    P Offline
    patrik08
    wrote on last edited by
    #1

    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();
    }
    
    
    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