diff --git a/QtScrcpy/device/controller/inputconvert/keymap/keymap.h b/QtScrcpy/device/controller/inputconvert/keymap/keymap.h index f21f814..ffc1d28 100644 --- a/QtScrcpy/device/controller/inputconvert/keymap/keymap.h +++ b/QtScrcpy/device/controller/inputconvert/keymap/keymap.h @@ -36,6 +36,20 @@ public: QPointF pos = QPointF(0, 0); // normal key QPointF extendPos = QPointF(0, 0); // for drag double extendOffset = 0.0; // for steerWheel + + KeyNode(ActionType type = AT_INVALID, + int key = Qt::Key_unknown, + QPointF pos = QPointF(0, 0), + QPointF extendPos = QPointF(0, 0), + double extendOffset = 0.0) + : type(type) + , key(key) + , pos(pos) + , extendPos(extendPos) + , extendOffset(extendOffset) + { + + } }; struct KeyMapNode { @@ -112,7 +126,7 @@ private: static QString s_keyMapPath; QVector m_keyMapNodes; - KeyNode m_switchKey = { AT_KEY, Qt::Key_QuoteLeft }; + KeyNode m_switchKey = {AT_KEY, Qt::Key_QuoteLeft}; // just for return KeyMapNode m_invalidNode; diff --git a/QtScrcpy/dialog.ui b/QtScrcpy/dialog.ui index 0d4440a..f22349b 100644 --- a/QtScrcpy/dialog.ui +++ b/QtScrcpy/dialog.ui @@ -7,7 +7,7 @@ 0 0 420 - 471 + 492 @@ -472,7 +472,7 @@ - 40 + 60 16777215 diff --git a/QtScrcpy/main.cpp b/QtScrcpy/main.cpp index 2ccb6a6..643eaaf 100644 --- a/QtScrcpy/main.cpp +++ b/QtScrcpy/main.cpp @@ -31,8 +31,10 @@ int main(int argc, char *argv[]) //update version QStringList versionList = QCoreApplication::applicationVersion().split("."); - QString version = versionList[0] + "." + versionList[1] + "." + versionList[2]; - a.setApplicationVersion(version); + if (versionList.size() >= 3) { + QString version = versionList[0] + "." + versionList[1] + "." + versionList[2]; + a.setApplicationVersion(version); + } installTranslator(); #if defined(Q_OS_WIN32) || defined(Q_OS_OSX) diff --git a/QtScrcpy/res/Info_mac.plist b/QtScrcpy/res/Info_mac.plist index cd3c70b..c32ac18 100644 --- a/QtScrcpy/res/Info_mac.plist +++ b/QtScrcpy/res/Info_mac.plist @@ -19,13 +19,13 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.4 + 1.2.0 CFBundleSupportedPlatforms MacOSX CFBundleVersion - 1.0.4 + 1.2.0 LSMinimumSystemVersion 10.10 NSHumanReadableCopyright diff --git a/docs/image/显示指针位置.jpg b/docs/image/显示指针位置.jpg new file mode 100644 index 0000000..a026fac Binary files /dev/null and b/docs/image/显示指针位置.jpg differ diff --git a/docs/按键映射说明.md b/docs/按键映射说明.md index 4c2e447..fbf14f9 100644 --- a/docs/按键映射说明.md +++ b/docs/按键映射说明.md @@ -11,6 +11,8 @@ - 按键映射中的坐标位置都是用相对位置表示的,屏幕的宽高都用1表示,例如屏幕的像素为1920x1080,那么坐标(0.5,0.5)则表示的是 以屏幕左上角为原点,像素坐标(1920,1080)*(0.5,0.5)=(960,540)的位置。 - 按键映射中的按键码是用Qt的枚举表示的,详细说明可以[参考Qt文档]( https://doc.qt.io/qt-5/qt.html )(搜索 The key names used by Qt. 可以快速定位)。 +- 开发人员选项中打开如下两个设置,可以方便的观察触摸点的坐标: +![](image/显示指针位置.jpg) ### 映射类型说明