Skip to content

feat(stream): add three-finger IME gesture - #43

Merged
qiin2333 merged 3 commits into
masterfrom
codex/three-finger-ime
Jun 18, 2026
Merged

feat(stream): add three-finger IME gesture#43
qiin2333 merged 3 commits into
masterfrom
codex/three-finger-ime

Conversation

@qiin2333

@qiin2333 qiin2333 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

改了啥呀

  • 在串流画面触摸入口前置三指本地手势,三指同时触摸时唤出 HarmonyOS IME。
  • 触发后三指这一组事件会被吞掉到全部抬起,避免远端收到半截多指输入,杂鱼卡键状态退退退。
  • 三指接管前会取消远端触摸、鼠标/触控板拖拽和缩放手势,同时保留已经应用的视频缩放状态。
  • 虚拟手柄覆盖层也转发本地多指手势,尽量让手柄显示时也能唤出 IME。

为啥要改

  • 对齐 Android 端三指触摸唤出 IME 的体验。
  • 给串流中需要中文/系统输入法的场景一个稳定的客户端入口。

验证

  • 通过:git diff --check
  • 通过:NODE_PATH=/Users/mac/Program/moonlight-harmony/hvigor/node_modules DEVECO_SDK_HOME=/Users/mac/ohos-sdk-cache/6.1-Release-mac/sdk-ci-shape JAVA_HOME=/Users/mac/ohos-sdk-cache/jdk17-temurin/Home PATH=/Users/mac/ohos-sdk-cache/jdk17-temurin/Home/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Library/Apple/usr/bin:/opt/homebrew/bin:/Users/mac/.codex/tmp/arg0/codex-arg0IHuenb:/Users/mac/.bun/bin:/Users/mac/.nvm/versions/node/v20.20.1/bin:/Users/mac/.orbstack/bin:/Applications/Codex.app/Contents/Resources:/Users/mac/.orbstack/bin node hvigorw.js assembleHap --mode module -p module=entry@default -p product=default --no-daemon

注:本地构建前按仓库现有流程执行过 bash ci/patch-sdk.sh /Users/mac/ohos-sdk-cache/6.1-Release-mac/sdk-ci-shape 来补公共 SDK stubs。

Summary by CodeRabbit

发布说明

  • 新功能

    • 支持三指触摸手势快速唤起系统输入法。
  • 改进

    • 优化了触摸事件和手势的响应处理逻辑,提升了输入交互的稳定性。

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@qiin2333, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 28 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 03a21b5c-6238-4834-8b7b-7655e39c9688

📥 Commits

Reviewing files that changed from the base of the PR and between d9b70d1 and abb78c6.

📒 Files selected for processing (2)
  • entry/src/main/ets/pages/StreamPage.ets
  • entry/src/main/ets/service/input/ThreeFingerImeGestureHandler.ets
📝 Walkthrough

Walkthrough

新增三指触摸唤起系统 IME 功能:在 PanZoomHandlerTouchInputHandlerTrackpadGestureHandler 各新增取消/清理方法;VirtualControllerOverlay 新增系统手势回调属性;StreamPage 实现三指检测逻辑并接入 XComponent 及覆盖层的触摸分发链路。

Changes

三指 IME 系统手势

Layer / File(s) Summary
输入服务层取消方法
entry/src/main/ets/service/input/PanZoomHandler.ets, entry/src/main/ets/service/input/TouchInputHandler.ets, entry/src/main/ets/service/input/TrackpadGestureHandler.ets
PanZoomHandler 新增 cancelActiveGesture() 保留当前变换快照并清空触点;TouchInputHandler 新增 cancelActiveInput() 释放 trackpad、重置鼠标状态并向 native 发送 TOUCH_EVENT_CANCEL_ALLTrackpadGestureHandler.dispose() 补充左键释放事件发送及内部标志/计数归零。
VirtualControllerOverlay 系统手势回调钩子
entry/src/main/ets/components/virtual/VirtualController.ets
新增 onSystemTouchGesture 回调属性(默认返回 false),.onTouch 中调用该回调,返回 true 时执行 event.stopPropagation()
StreamPage 三指 IME 手势检测与接入
entry/src/main/ets/pages/StreamPage.ets
新增激活状态与定时器字段;实现 handleSystemTouchGesture(过滤鼠标源、检测三指)、getActiveFingerCountscheduleThreeFingerImeResetresetThreeFingerImeGesture;命中时取消输入与缩放手势并展示 IME,3 秒后自动重置;aboutToDisappear 清理定时器;XComponent 触摸入口优先拦截,VirtualControllerOverlay 接入 onSystemTouchGesture 回调。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 标题准确概括了主要功能变更:新增三指触摸手势以唤出 IME 输入法,标题简洁明了且与改动内容完全相符。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/three-finger-ime

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@entry/src/main/ets/pages/StreamPage.ets`:
- Around line 1806-1813: The scheduleThreeFingerImeReset method unconditionally
calls resetThreeFingerImeGesture after 3 seconds, which causes the three-finger
gesture to be cleared prematurely even while the user is still holding down
their fingers. This allows subsequent Move/Up events to be transmitted to the
remote end, triggering unwanted IME behavior. Modify the setTimeout callback in
scheduleThreeFingerImeReset to only call resetThreeFingerImeGesture if there are
no active touch points remaining, effectively converting the 3-second timer into
a watchdog that only resets the gesture when the user has released all their
fingers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 84885dcd-f9e7-49e2-84c4-c12b79490072

📥 Commits

Reviewing files that changed from the base of the PR and between 970d8fd and d9b70d1.

📒 Files selected for processing (5)
  • entry/src/main/ets/components/virtual/VirtualController.ets
  • entry/src/main/ets/pages/StreamPage.ets
  • entry/src/main/ets/service/input/PanZoomHandler.ets
  • entry/src/main/ets/service/input/TouchInputHandler.ets
  • entry/src/main/ets/service/input/TrackpadGestureHandler.ets

Comment thread entry/src/main/ets/pages/StreamPage.ets Outdated
@qiin2333
qiin2333 merged commit 1f95133 into master Jun 18, 2026
2 checks passed
@qiin2333
qiin2333 deleted the codex/three-finger-ime branch June 18, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant