mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-02 13:58:37 +00:00
feat: repeat pos return
This commit is contained in:
parent
4176bcefe0
commit
67a48165dd
1 changed files with 9 additions and 2 deletions
|
@ -164,8 +164,15 @@ void InputConvertGame::sendTouchEvent(int id, QPointF pos, AndroidMotioneventAct
|
||||||
if (!controlMsg) {
|
if (!controlMsg) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
controlMsg->setInjectTouchMsgData(
|
|
||||||
static_cast<quint64>(id), action, static_cast<AndroidMotioneventButtons>(0), QRect(calcFrameAbsolutePos(pos).toPoint(), m_frameSize), 1.0f);
|
QPoint absolutePos = calcFrameAbsolutePos(pos).toPoint();
|
||||||
|
static QPoint lastAbsolutePos = absolutePos;
|
||||||
|
if (AMOTION_EVENT_ACTION_MOVE == action && lastAbsolutePos == absolutePos) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lastAbsolutePos = absolutePos;
|
||||||
|
|
||||||
|
controlMsg->setInjectTouchMsgData(static_cast<quint64>(id), action, static_cast<AndroidMotioneventButtons>(0), QRect(absolutePos, m_frameSize), 1.0f);
|
||||||
sendControlMsg(controlMsg);
|
sendControlMsg(controlMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue