Skip to content

Commit

Permalink
fix: 除非 reset,期望当前时间不允许倒流
Browse files Browse the repository at this point in the history
  • Loading branch information
zzyyyl committed Oct 18, 2023
1 parent cfd575b commit 31b5289
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/com/shxyke/MaaTouch/ControlThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public void handleMessage(ControlMessage msg) {
switch (msg.getType()) {
case ControlMessage.TYPE_EVENT_TOUCH_RESET:
controller.resetAll();
expectedNow = System.currentTimeMillis();
break;
case ControlMessage.TYPE_EVENT_TOUCH_DOWN:
controller.injectTouchDown(msg.getPointerId(), msg.getPoint(), msg.getPressure());
Expand Down Expand Up @@ -49,7 +50,8 @@ public void handleMessage(ControlMessage msg) {
}
break;
case ControlMessage.TYPE_EVENT_WAIT_TIMESTAMP_SYNC:
expectedNow = msg.getMillis();
if (expectedNow < msg.getMillis())
expectedNow = msg.getMillis();
break;
default:
break;
Expand Down

0 comments on commit 31b5289

Please sign in to comment.