mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-07-29 20:28:38 +00:00
降低鼠标灵敏度(待优化)
This commit is contained in:
parent
8aaba33104
commit
9d17a1b811
2 changed files with 15 additions and 6 deletions
|
@ -267,12 +267,16 @@ bool InputConvertGame::processKeyClick(const QKeyEvent *from)
|
|||
clickPos = QPointF(0.96f, 0.7f);
|
||||
break;
|
||||
case Qt::Key_M: // 地图
|
||||
switchGameMap();
|
||||
if (QEvent::KeyRelease == from->type()) {
|
||||
switchGameMap();
|
||||
}
|
||||
clickPos = QPointF(0.98f, 0.03f);
|
||||
break;
|
||||
case Qt::Key_Tab: // 背包
|
||||
if (QEvent::KeyRelease == from->type()) {
|
||||
switchGameMap();
|
||||
}
|
||||
clickPos = QPointF(0.06f, 0.9f);
|
||||
switchGameMap();
|
||||
break;
|
||||
case Qt::Key_Z: // 趴
|
||||
clickPos = QPointF(0.95f, 0.9f);
|
||||
|
@ -382,13 +386,17 @@ bool InputConvertGame::processMouseMove(const QMouseEvent *from)
|
|||
// convert pos
|
||||
pos.setX(pos.x() / m_showSize.width());
|
||||
pos.setY(pos.y() / m_showSize.height());
|
||||
sendTouchMoveEvent(getTouchID(Qt::ExtraButton24), pos);
|
||||
m_mouseMoveLastPos = pos;
|
||||
|
||||
if (pos.x() < 0.1 || pos.x() > 0.9 || pos.y() < 0.1 || pos.y() > 0.9) {
|
||||
mouseMoveStopTouch();
|
||||
mouseMoveStartTouch(from);
|
||||
}
|
||||
|
||||
if (!m_mouseMoveLastPos.isNull()) {
|
||||
pos = (m_mouseMoveLastPos + pos)/4;
|
||||
}
|
||||
sendTouchMoveEvent(getTouchID(Qt::ExtraButton24), pos);
|
||||
m_mouseMoveLastPos = pos;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -430,6 +438,7 @@ void InputConvertGame::mouseMoveStopTouch()
|
|||
{
|
||||
if (m_mouseMovePress) {
|
||||
sendTouchUpEvent(getTouchID(Qt::ExtraButton24), m_mouseMoveLastPos);
|
||||
m_mouseMoveLastPos = QPointF(0.0f, 0.0f);
|
||||
detachTouchID(Qt::ExtraButton24);
|
||||
m_mouseMovePress = false;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ private:
|
|||
|
||||
// mouse move
|
||||
QPointF m_mouseMoveStartPos = {0.57f, 0.26f};
|
||||
QPointF m_mouseMoveLastPos;
|
||||
QPointF m_mouseMoveLastPos = {0.0f, 0.0f};
|
||||
bool m_mouseMovePress = false;
|
||||
int m_mouseMoveTimer = 0;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue