mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-03 14:18:45 +00:00
Merge branch 'dev' into xmousetap-pr
This commit is contained in:
commit
e7d6e677b3
4 changed files with 40 additions and 7 deletions
|
@ -470,6 +470,8 @@ bool InputConvertGame::switchGameMap()
|
||||||
QGuiApplication::setOverrideCursor(QCursor(Qt::CrossCursor));
|
QGuiApplication::setOverrideCursor(QCursor(Qt::CrossCursor));
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
stopMouseMoveTimer();
|
||||||
|
mouseMoveStopTouch();
|
||||||
QGuiApplication::restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
return m_gameMap;
|
return m_gameMap;
|
||||||
|
|
|
@ -92,6 +92,7 @@ QRect VideoForm::getGrabCursorRect()
|
||||||
// high dpi support
|
// high dpi support
|
||||||
rc.setTopLeft(rc.topLeft() * m_videoWidget->devicePixelRatio());
|
rc.setTopLeft(rc.topLeft() * m_videoWidget->devicePixelRatio());
|
||||||
rc.setBottomRight(rc.bottomRight() * m_videoWidget->devicePixelRatio());
|
rc.setBottomRight(rc.bottomRight() * m_videoWidget->devicePixelRatio());
|
||||||
|
|
||||||
rc.setX(rc.x() + 10);
|
rc.setX(rc.x() + 10);
|
||||||
rc.setY(rc.y() + 10);
|
rc.setY(rc.y() + 10);
|
||||||
rc.setWidth(rc.width() - 20);
|
rc.setWidth(rc.width() - 20);
|
||||||
|
@ -100,15 +101,21 @@ QRect VideoForm::getGrabCursorRect()
|
||||||
rc = m_videoWidget->geometry();
|
rc = m_videoWidget->geometry();
|
||||||
rc.setTopLeft(ui->keepRadioWidget->mapToGlobal(rc.topLeft()));
|
rc.setTopLeft(ui->keepRadioWidget->mapToGlobal(rc.topLeft()));
|
||||||
rc.setBottomRight(ui->keepRadioWidget->mapToGlobal(rc.bottomRight()));
|
rc.setBottomRight(ui->keepRadioWidget->mapToGlobal(rc.bottomRight()));
|
||||||
rc.setX(rc.x() + 100);
|
|
||||||
rc.setY(rc.y() + 30);
|
rc.setX(rc.x() + 10);
|
||||||
rc.setWidth(rc.width() - 180);
|
rc.setY(rc.y() + 10);
|
||||||
rc.setHeight(rc.height() - 60);
|
rc.setWidth(rc.width() - 20);
|
||||||
|
rc.setHeight(rc.height() - 20);
|
||||||
#elif defined(Q_OS_LINUX)
|
#elif defined(Q_OS_LINUX)
|
||||||
rc = QRect(ui->keepRadioWidget->mapToGlobal(m_videoWidget->pos()), m_videoWidget->size());
|
rc = QRect(ui->keepRadioWidget->mapToGlobal(m_videoWidget->pos()), m_videoWidget->size());
|
||||||
// high dpi support -- taken from the WIN32 section and untested
|
// high dpi support -- taken from the WIN32 section and untested
|
||||||
rc.setTopLeft(rc.topLeft() * m_videoWidget->devicePixelRatio());
|
rc.setTopLeft(rc.topLeft() * m_videoWidget->devicePixelRatio());
|
||||||
rc.setBottomRight(rc.bottomRight() * m_videoWidget->devicePixelRatio());
|
rc.setBottomRight(rc.bottomRight() * m_videoWidget->devicePixelRatio());
|
||||||
|
|
||||||
|
rc.setX(rc.x() + 10);
|
||||||
|
rc.setY(rc.y() + 10);
|
||||||
|
rc.setWidth(rc.width() - 20);
|
||||||
|
rc.setHeight(rc.height() - 20);
|
||||||
#endif
|
#endif
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -504,7 +511,7 @@ void VideoForm::mousePressEvent(QMouseEvent *event)
|
||||||
qreal x = event->localPos().x() / m_videoWidget->size().width();
|
qreal x = event->localPos().x() / m_videoWidget->size().width();
|
||||||
qreal y = event->localPos().y() / m_videoWidget->size().height();
|
qreal y = event->localPos().y() / m_videoWidget->size().height();
|
||||||
QString posTip = QString(R"("pos": {"x": %1, "y": %2})").arg(x).arg(y);
|
QString posTip = QString(R"("pos": {"x": %1, "y": %2})").arg(x).arg(y);
|
||||||
qInfo(posTip.toStdString().c_str());
|
qInfo() << posTip.toStdString().c_str();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (event->button() == Qt::LeftButton) {
|
if (event->button() == Qt::LeftButton) {
|
||||||
|
|
|
@ -85,12 +85,16 @@ Dialog::~Dialog()
|
||||||
void Dialog::initUI()
|
void Dialog::initUI()
|
||||||
{
|
{
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
setWindowFlags(windowFlags() | Qt::WindowMinimizeButtonHint);
|
setWindowFlags(windowFlags() | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint);
|
||||||
|
|
||||||
ui->bitRateBox->addItem("2000000");
|
ui->bitRateBox->addItem("2000000");
|
||||||
ui->bitRateBox->addItem("6000000");
|
ui->bitRateBox->addItem("6000000");
|
||||||
ui->bitRateBox->addItem("8000000");
|
ui->bitRateBox->addItem("8000000");
|
||||||
ui->bitRateBox->addItem("10000000");
|
ui->bitRateBox->addItem("10000000");
|
||||||
|
ui->bitRateBox->addItem("20000000");
|
||||||
|
ui->bitRateBox->addItem("50000000");
|
||||||
|
ui->bitRateBox->addItem("100000000");
|
||||||
|
ui->bitRateBox->addItem("200000000");
|
||||||
ui->bitRateBox->setCurrentIndex(Config::getInstance().getBitRateIndex());
|
ui->bitRateBox->setCurrentIndex(Config::getInstance().getBitRateIndex());
|
||||||
|
|
||||||
ui->maxSizeBox->addItem("640");
|
ui->maxSizeBox->addItem("640");
|
||||||
|
|
|
@ -52,6 +52,16 @@
|
||||||
"y": 0.35
|
"y": 0.35
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"comment": "自动跑",
|
||||||
|
"type": "KMT_CLICK",
|
||||||
|
"key": "Key_Equal",
|
||||||
|
"pos": {
|
||||||
|
"x": 0.84,
|
||||||
|
"y": 0.26
|
||||||
|
},
|
||||||
|
"switchMap": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"comment": "跳",
|
"comment": "跳",
|
||||||
"type": "KMT_CLICK",
|
"type": "KMT_CLICK",
|
||||||
|
@ -82,6 +92,16 @@
|
||||||
},
|
},
|
||||||
"switchMap": true
|
"switchMap": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"comment": "视角",
|
||||||
|
"type": "KMT_CLICK",
|
||||||
|
"key": "Key_V",
|
||||||
|
"pos": {
|
||||||
|
"x": 0.23,
|
||||||
|
"y": 0.95
|
||||||
|
},
|
||||||
|
"switchMap": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"comment": "趴",
|
"comment": "趴",
|
||||||
"type": "KMT_CLICK",
|
"type": "KMT_CLICK",
|
||||||
|
@ -253,4 +273,4 @@
|
||||||
"switchMap": false
|
"switchMap": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue