mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-10 09:28:40 +00:00
fix: game keymap invalid
don't send AMOTION_EVENT_ACTION_MOVE without left button press
This commit is contained in:
parent
b1f7611a87
commit
addac5807c
2 changed files with 5 additions and 1 deletions
|
@ -134,7 +134,7 @@ void InputConvertGame::sendTouchEvent(int id, QPointF pos, AndroidMotioneventAct
|
|||
Q_ASSERT(0);
|
||||
return;
|
||||
}
|
||||
qDebug() << "id:" << id << " pos:" << pos << " action" << action;
|
||||
//qDebug() << "id:" << id << " pos:" << pos << " action" << action;
|
||||
ControlMsg* controlMsg = new ControlMsg(ControlMsg::CMT_INJECT_TOUCH);
|
||||
if (!controlMsg) {
|
||||
return;
|
||||
|
|
|
@ -27,6 +27,10 @@ void InputConvertNormal::mouseEvent(const QMouseEvent* from, const QSize& frameS
|
|||
action = AMOTION_EVENT_ACTION_UP;
|
||||
break;
|
||||
case QEvent::MouseMove:
|
||||
// only support left button drag
|
||||
if (!(from->buttons() & Qt::LeftButton)) {
|
||||
return;
|
||||
}
|
||||
action = AMOTION_EVENT_ACTION_MOVE;
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue