fix: game keymap invalid

don't send AMOTION_EVENT_ACTION_MOVE without left button press
This commit is contained in:
rankun 2020-01-19 14:52:55 +08:00
commit addac5807c
2 changed files with 5 additions and 1 deletions

View file

@ -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;

View file

@ -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: