diff --git a/entry/src/main/ets/service/TrackpadGestureHandler.ets b/entry/src/main/ets/service/TrackpadGestureHandler.ets index c5f43fd..f0574dc 100644 --- a/entry/src/main/ets/service/TrackpadGestureHandler.ets +++ b/entry/src/main/ets/service/TrackpadGestureHandler.ets @@ -258,7 +258,7 @@ export class TrackpadGestureHandler { state.lastX = touches[0].x; state.lastY = touches[0].y; if (Math.abs(dy) > 0) { - this.sink.sendMouseHighResScroll(Math.round(-dy * SCROLL_SPEED_FACTOR)); + this.sink.sendMouseHighResScroll(Math.round(dy * SCROLL_SPEED_FACTOR)); } } // 同步第二根手指 @@ -342,6 +342,7 @@ export class TrackpadGestureHandler { this.maxCountInGesture = 0; this.confirmedMove = false; this.confirmedDrag = false; + this.confirmedScroll = false; this.distanceMoved = 0; } @@ -354,6 +355,7 @@ export class TrackpadGestureHandler { private resetGestureFlags(): void { this.confirmedMove = false; this.confirmedDrag = false; + this.confirmedScroll = false; this.distanceMoved = 0; this.isDoubleClickDrag = false; this.isPotentialDoubleClick = false; diff --git a/nativelib/src/main/cpp/usb_ddk_poller.cpp b/nativelib/src/main/cpp/usb_ddk_poller.cpp index bfa7dd0..f115a65 100644 --- a/nativelib/src/main/cpp/usb_ddk_poller.cpp +++ b/nativelib/src/main/cpp/usb_ddk_poller.cpp @@ -514,7 +514,8 @@ static void *ddkPollThread(void *arg) { if (ret == USB_DDK_IO_FAILED || ret == USB_DDK_INVALID_OP) { // === 智能错误恢复 === - // 瞬态错误保留最后输入状态(不归零),避免中断长按 + // 错误打断了数据连续性,去重缓存失效:恢复后第一帧必须传递给 JS + ctx->lastInputValid = false; if (consecutiveErrors == 3) { OH_LOG_WARN(LOG_APP, "[%{public}s] id=%{public}d 连续 %d 次错误,尝试恢复", LOG_TAG, pollerId, consecutiveErrors); }