Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion entry/src/main/ets/service/TrackpadGestureHandler.ets
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
// 同步第二根手指
Expand Down Expand Up @@ -342,6 +342,7 @@ export class TrackpadGestureHandler {
this.maxCountInGesture = 0;
this.confirmedMove = false;
this.confirmedDrag = false;
this.confirmedScroll = false;
this.distanceMoved = 0;
}

Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion nativelib/src/main/cpp/usb_ddk_poller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Loading