From 70a8aba930ca6388a18299c8eba4d97336557b64 Mon Sep 17 00:00:00 2001
From: Barry <870709864@qq.com>
Date: Tue, 4 Dec 2018 21:21:28 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
QtScrcpy/inputcontrol/inputconvertgame.cpp | 2 +-
QtScrcpy/videoform.cpp | 13 ++++++++-----
QtScrcpy/videoform.ui | 6 ++++++
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/QtScrcpy/inputcontrol/inputconvertgame.cpp b/QtScrcpy/inputcontrol/inputconvertgame.cpp
index 09b730e..17a991d 100644
--- a/QtScrcpy/inputcontrol/inputconvertgame.cpp
+++ b/QtScrcpy/inputcontrol/inputconvertgame.cpp
@@ -404,7 +404,7 @@ bool InputConvertGame::processMouseMove(const QMouseEvent *from)
if (!m_mouseMoveLastPos.isNull()) {
QPointF distance = from->localPos() - m_mouseMoveLastPos;
- distance /= 8;
+ distance /= 10;
mouseMoveStartTouch(from);
startMouseMoveTimer();
diff --git a/QtScrcpy/videoform.cpp b/QtScrcpy/videoform.cpp
index e113742..663af48 100644
--- a/QtScrcpy/videoform.cpp
+++ b/QtScrcpy/videoform.cpp
@@ -23,11 +23,13 @@ VideoForm::VideoForm(const QString& serial, QWidget *parent) :
connect(&m_inputConvert, &InputConvertGame::grabCursor, this, [this](bool grab){
#ifdef Q_OS_WIN32
if(grab) {
+ QRect rc(mapToGlobal(ui->videoWidget->pos())
+ , ui->videoWidget->size());
RECT mainRect;
- mainRect.left = (LONG)this->geometry().left();
- mainRect.right = (LONG)this->geometry().right();
- mainRect.top = (LONG)this->geometry().top();
- mainRect.bottom = (LONG)this->geometry().bottom();
+ mainRect.left = (LONG)rc.left();
+ mainRect.right = (LONG)rc.right();
+ mainRect.top = (LONG)rc.top();
+ mainRect.bottom = (LONG)rc.bottom();
ClipCursor(&mainRect);
} else {
ClipCursor(Q_NULLPTR);
@@ -198,7 +200,8 @@ void VideoForm::keyReleaseEvent(QKeyEvent *event)
void VideoForm::on_fullScrcenbtn_clicked()
{
- switchFullScreen();
+ QKeySequence s =ui->fullScrcenbtn->shortcut();
+ switchFullScreen();
}
void VideoForm::on_returnBtn_clicked()
diff --git a/QtScrcpy/videoform.ui b/QtScrcpy/videoform.ui
index 785897d..e4bf7e1 100644
--- a/QtScrcpy/videoform.ui
+++ b/QtScrcpy/videoform.ui
@@ -67,6 +67,9 @@
40
+
+ Qt::NoFocus
+
@@ -99,6 +102,9 @@
40
+
+ Qt::NoFocus
+