mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 03:25:02 +00:00
feat: repeat pos return
This commit is contained in:
parent
a38f74a49b
commit
27a959df4b
1 changed files with 9 additions and 2 deletions
|
@ -164,8 +164,15 @@ void InputConvertGame::sendTouchEvent(int id, QPointF pos, AndroidMotioneventAct
|
|||
if (!controlMsg) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue