https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#pointerevent
| 610 | |
| 611 | // https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#pointerevent |
| 612 | void CBackendLibVNCServer::wheelEvent(QWheelEvent *event) |
| 613 | { |
| 614 | if(!m_pClient) return; |
| 615 | if(m_pParameter && m_pParameter->GetOnlyView()) return; |
| 616 | int mask = 0; |
| 617 | if(event->buttons() & Qt::MouseButton::LeftButton) |
| 618 | mask |= 0x1; |
| 619 | if(event->buttons() & Qt::MouseButton::MiddleButton) |
| 620 | mask |= 0x2; |
| 621 | if(event->buttons() & Qt::MouseButton::RightButton) |
| 622 | mask |= 0x4; |
| 623 | if(event->buttons() & Qt::MouseButton::BackButton) |
| 624 | mask |= 0x80; |
| 625 | |
| 626 | QPoint d = event->angleDelta(); |
| 627 | if(d.y() > 0) |
| 628 | mask |= 0x8; |
| 629 | if(d.y() < 0) |
| 630 | mask |= 0x10; |
| 631 | if(d.x() < 0) |
| 632 | mask |= 0x20; |
| 633 | if(d.x() > 0) |
| 634 | mask |= 0x40; |
| 635 | |
| 636 | QPointF pos; |
| 637 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 638 | pos = event->position(); |
| 639 | #else |
| 640 | pos = event->pos(); |
| 641 | #endif |
| 642 | |
| 643 | qDebug(logMouse) << Q_FUNC_INFO << event->buttons() << event->angleDelta() << pos; |
| 644 | |
| 645 | SendPointerEvent(m_pClient, pos.x(), pos.y(), mask); |
| 646 | } |
| 647 | |
| 648 | /** |
| 649 | * @brief CConnectTigerVnc::TranslateRfbKey |
nothing calls this directly
no test coverage detected