奇怪,我也编译运行成功,但是无论用哪个脚本,电脑按键事件都不能触发屏幕的点击和手势动作呢?
看软件提示,按 ~ 可以切换
]]>diff --git a/QtScrcpy/QtScrcpy.pro b/QtScrcpy/QtScrcpy.pro
index 0afdc4e..d0ba2cd 100644
--- a/QtScrcpy/QtScrcpy.pro
+++ b/QtScrcpy/QtScrcpy.pro
@@ -142,7 +142,7 @@ win32 {
QMAKE_POST_LINK += $$quote($$QMAKE_COPY $$WIN_FFMPEG_SRC $$WIN_DST$$escape_expand(\n\t))
# windows rc file
- RC_FILE = $$PWD/res/QtScrcpy.rc
+ #RC_FILE = $$PWD/res/QtScrcpy.rc
}
# ***********************************************************
diff --git a/QtScrcpy/adb/adbprocess.cpp b/QtScrcpy/adb/adbprocess.cpp
index ad14835..7af3685 100644
--- a/QtScrcpy/adb/adbprocess.cpp
+++ b/QtScrcpy/adb/adbprocess.cpp
@@ -1,4 +1,4 @@
-#include <QCoreApplication>
+#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
@@ -116,9 +116,9 @@ QStringList AdbProcess::getDevicesSerialFromStdOut()
{
// get devices serial by adb devices
QStringList serials;
- QStringList devicesInfoList = m_standardOutput.split(QRegExp("\r\n|\n"), Qt::SkipEmptyParts);
+ QStringList devicesInfoList = m_standardOutput.split(QRegExp("\r\n|\n"), QString::SkipEmptyParts);
for (QString deviceInfo : devicesInfoList) {
- QStringList deviceInfos = deviceInfo.split(QRegExp("\t"), Qt::SkipEmptyParts);
+ QStringList deviceInfos = deviceInfo.split(QRegExp("\t"), QString::SkipEmptyParts);
if (2 == deviceInfos.count() && 0 == deviceInfos[1].compare("device")) {
serials << deviceInfos[0];
}
diff --git a/QtScrcpy/device/controller/inputconvert/inputconvertnormal.cpp b/QtScrcpy/device/controller/inputconvert/inputconvertnormal.cpp
index 63924e1..6362231 100644
--- a/QtScrcpy/device/controller/inputconvert/inputconvertnormal.cpp
+++ b/QtScrcpy/device/controller/inputconvert/inputconvertnormal.cpp
@@ -1,4 +1,4 @@
-#include <cmath>
+#include <cmath>
#include "inputconvertnormal.h"
@@ -59,7 +59,7 @@ void InputConvertNormal::wheelEvent(const QWheelEvent *from, const QSize &frameS
qint32 vScroll = from->angleDelta().y() == 0 ? 0 : from->angleDelta().y() / abs(from->angleDelta().y()) * 2;
// pos
- QPointF pos = from->position();
+ QPointF pos = from->posF();
// convert pos
pos.setX(pos.x() * frameSize.width() / showSize.width());
pos.setY(pos.y() * frameSize.height() / showSize.height());
diff --git a/QtScrcpy/device/ui/videoform.cpp b/QtScrcpy/device/ui/videoform.cpp
index 36a6ef4..7fb9468 100644
--- a/QtScrcpy/device/ui/videoform.cpp
+++ b/QtScrcpy/device/ui/videoform.cpp
@@ -1,4 +1,4 @@
-#include <QDesktopWidget>
+#include <QDesktopWidget>
#include <QFileInfo>
#include <QLabel>
#include <QMessageBox>
@@ -611,13 +611,13 @@ void VideoForm::mouseDoubleClickEvent(QMouseEvent *event)
void VideoForm::wheelEvent(QWheelEvent *event)
{
- if (m_videoWidget->geometry().contains(event->position().toPoint())) {
+ if (m_videoWidget->geometry().contains(event->posF().toPoint())) {
if (!m_device) {
return;
}
- QPointF pos = m_videoWidget->mapFrom(this, event->position().toPoint());
+ QPointF pos = m_videoWidget->mapFrom(this, event->posF().toPoint());
QWheelEvent wheelEvent(
- pos, event->globalPosition(), event->pixelDelta(), event->angleDelta(), event->buttons(), event->modifiers(), event->phase(), event->inverted());
+ pos, event->globalPosF(), event->pixelDelta(), event->angleDelta(), event->buttons(), event->modifiers(), event->phase(), event->inverted());
emit m_device->wheelEvent(&wheelEvent, m_videoWidget->frameSize(), m_videoWidget->size());
}
}
diff --git a/QtScrcpy/dialog.cpp b/QtScrcpy/dialog.cpp
index e5f6827..d143f67 100644
--- a/QtScrcpy/dialog.cpp
+++ b/QtScrcpy/dialog.cpp
@@ -1,4 +1,4 @@
-#include <QDebug>
+#include <QDebug>
#include <QFile>
#include <QFileDialog>
#include <QKeyEvent>
@@ -137,7 +137,7 @@ void Dialog::execAdbCmd()
}
QString cmd = ui->adbCommandEdt->text().trimmed();
outLog("adb " + cmd, false);
- m_adb.execute(ui->serialBox->currentText().trimmed(), cmd.split(" ", Qt::SkipEmptyParts));
+ m_adb.execute(ui->serialBox->currentText().trimmed(), cmd.split(" ", QString::SkipEmptyParts));
}
QString Dialog::getGameScript(const QString &fileName)
Qt5.12.3 mingw64 可以编译成功 ^_^
]]>要不要试一试 Qt 版本 的scrpy ==>
https://github.com/barry-ran/QtScrcpy/blob/master/README_zh.md
]]>ubuntu 也不太难。
]]>win10下测试了,很顺利,很好玩啊。
ubtuntu16.04,编译不成功,没体验到,折腾一上午了
---
回头再研究上开发板上怎么玩,感觉只有在板子上跑,才能体会装x的快乐。。。
2,1,3 吧
可以跑下4楼的预编译文件, 直观感受一下, 还是挺好玩的。