Skip to content

feat(input): make three-finger IME gesture optional - #97

Merged
qiin2333 merged 1 commit into
masterfrom
codex/three-finger-ime-toggle
Jul 31, 2026
Merged

feat(input): make three-finger IME gesture optional#97
qiin2333 merged 1 commit into
masterfrom
codex/three-finger-ime-toggle

Conversation

@qiin2333

@qiin2333 qiin2333 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

改了啥呀

  • 在「设置 → 鼠标和触控」增加「三指唤出输入法」开关,默认开启并持久化
  • 关闭后不再让本地 IME 手势抢走三指触摸,触摸事件继续交给当前串流输入链路
  • 更新 moonlight-common-c 到 7bfa0c1,同步 HEVC SEI 保留和本地光标形状协议
  • 将新增的 CursorStream.c 纳入 HarmonyOS 原生构建,收拾掉漏接源文件导致的杂鱼链接错误

为啥要改

三指唤出输入法对需要键盘输入的场景很方便,但也可能与主机端三指操作冲突。现在保留原有默认行为,同时让不需要它的用户可以明确关闭;关闭后不会再吞掉这一组触摸。

common-c 已经增加了本地光标形状协议,主工程又是手工维护源文件列表,所以同步子模块时也必须把新增实现加入构建,不然只更新 gitlink 会在链接阶段缺符号啦。

验证

  • npm run check
  • git diff --check
  • DEVECO_SDK_HOME=/Applications/DevEco-Studio.app/Contents/sdk JAVA_HOME=/Applications/DevEco-Studio.app/Contents/jbr/Contents/Home PATH=/Applications/DevEco-Studio.app/Contents/jbr/Contents/Home/bin:/Users/mac/.nvm/versions/node/v20.20.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin node hvigorw.js assembleApp --mode project -p product=default -p buildMode=debug --no-daemon
  • DevEco Hvigor 完整 Debug 构建成功
  • common-c cursor-protocol-golden-tests:1/1 通过

Summary by CodeRabbit

  • 新功能
    • 新增“三指唤出输入法”设置,默认启用,支持在鼠标/触控设置中随时切换并保存。
    • 三指手势仅在启用设置且已连接串流时生效。
  • 改进
    • 完善光标相关功能支持,提升串流操作体验。

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

三指输入法设置

Layer / File(s) Summary
三指输入法设置流程
entry/src/main/ets/service/SettingsService.ets, entry/src/main/ets/pages/SettingsPageV2.ets, entry/src/main/ets/pages/StreamPage.ets
新增默认值为 true 的持久化设置。设置页面提供开关并保存状态。串流页面仅在已连接且开关启用时处理三指输入法手势。

原生库构建更新

Layer / File(s) Summary
CursorStream 原生构建接入
nativelib/src/main/cpp/CMakeLists.txt, nativelib/src/main/cpp/moonlight-common-c
CursorStream.c 加入公共源文件集合,并更新 moonlight-common-c 子模块引用。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 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 标题准确概括了主要变更:将三指唤出输入法手势改为可选功能。
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/three-finger-ime-toggle

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.

@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 `@nativelib/src/main/cpp/moonlight-common-c`:
- Line 1: 更新 moonlight-common-c 子模块的 gitlink,替换当前不可获取的提交为
qiin2333/moonlight-common-c 中可用且包含 CursorStream.c 的提交;确认其符号接口与现有 CMakeLists.txt
及 ArkTS 原生桥接兼容。
🪄 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 Plus

Run ID: 17dae4fe-93f4-46bf-94d4-21ebb35db14b

📥 Commits

Reviewing files that changed from the base of the PR and between 1afa53c and 1f43d19.

📒 Files selected for processing (5)
  • entry/src/main/ets/pages/SettingsPageV2.ets
  • entry/src/main/ets/pages/StreamPage.ets
  • entry/src/main/ets/service/SettingsService.ets
  • nativelib/src/main/cpp/CMakeLists.txt
  • nativelib/src/main/cpp/moonlight-common-c

@@ -1 +1 @@
Subproject commit 2b913d47a4d29b0825c3fe748493fd336d80a241
Subproject commit 7bfa0c1e79d55871c519287c441a629b9eeed045

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

submodule='nativelib/src/main/cpp/moonlight-common-c'
expected='7bfa0c1e79d55871c519287c441a629b9eeed045'

actual="$(git ls-tree HEAD "$submodule" | awk '{print $3}')"
test "$actual" = "$expected"

git -C "$submodule" ls-tree -r --name-only "$expected" \
  | grep -E '(^|/)CursorStream\.c$'

rg -n 'MOONLIGHT_COMMON_SOURCES|CursorStream\.c' nativelib/src/main/cpp

Repository: AlkaidLab/moonlight-harmony

Length of output: 337


🏁 Script executed:

#!/bin/bash
set -u

echo "== submodule entries =="
git ls-files -s | grep '160000 nativelib/src/main/cpp/moonlight-common-c' || true

echo "== repo remotes / objects =="
git remote -v || true
git cat-file -t 7bfa0c1e79d55871c519287c441a629b9eeed045 2>&1 || true
git cat-file -p 7bfa0c1e79d55871c519287c441a629b9eeed045 2>&1 | head -n 20 || true
git cat-file -t HEAD:nativelib/src/main/cpp/moonlight-common-c 2>&1 || true
git ls-tree HEAD nativelib/src/main/cpp/moonlight-common-c || true

echo "== submodule config / lockfiles =="
git config -f .gitmodules --get-regexp path || true
git config -f .gitmodules --get-regexp nativelib/src/main/cpp/moonlight-common-c || true
git config -f .git/config --get-regexp core || true
git config -f .git/config --get-regexp submodule || true
for f in .gitmodules .git/config; do
  echo "--- $f"
  [ -f "$f" ] && sed -n '1,220p' "$f"
done

echo "== native build references =="
rg -n 'moonlight-common-c|MOONLIGHT_COMMON_SOURCES|CursorStream\.c|cursor-protocol-golden-tests' .

Repository: AlkaidLab/moonlight-harmony

Length of output: 7411


🏁 Script executed:

#!/bin/bash
set -euo pipefail

git config --get remotes.origin.fetch
git fetch origin refs/heads/master:refs/remotes/origin/master --quiet 2>/dev/null || true
git fetch origin --quiet 2>/dev/null || true

expected='7bfa0c1e79d55871c519287c441a629b9eeed045'

echo "== submodule commit availability =="
git cat-file -t "$expected" || true

if git cat-file -t "$expected" >/dev/null 2>&1; then
  echo "== commit type =="
  git cat-file -t "$expected"

  echo "== submodule head sha from current commit =="
  git ls-tree HEAD nativelib/src/main/cpp/moonlight-common-c

  echo "== submodule tree contents around CursorStream =="
  git ls-tree -r "$expected" -- nativelib/src/main/cpp/moonlight-common-c \
    | sed -n '1,80p'
  git ls-tree -r "$expected" -- | grep -E '(^|/)CursorStream\.c$' || true

  echo "== upstream moonlight-common-c refs for branch m..."
  git ls-remote https://github.com/qiin2333/moonlight-common-c.git | grep -E 'refs/(heads|tags)/mic|7bfa0c1e79d55871c519287c441a629b9eeed045' || true
else
  echo "== object unavailable locally; show diffstat for submodule path =="
  git diff --stat HEAD^..HEAD -- nativelib/src/main/cpp/moonlight-common-c || true
  git diff -- nativelib/src/main/cpp/moonlight-common-c | sed -n '1,160p' || true
fi

echo "== native CMake source entries =="
sed -n '105,160p' nativelib/src/main/cpp/CMakeLists.txt

Repository: AlkaidLab/moonlight-harmony

Length of output: 165


🌐 Web query:

github qiin2333 moonlight-common-c gitlink 7bfa0c1e79d55871c519287c441a629b9eeed045 CursorStream.c

💡 Result:

The file CursorStream.c does not exist in the official moonlight-stream/moonlight-common-c repository [1][2]. Moonlight-common-c is a core library for Nvidia's GameStream protocol, and its source files are primarily dedicated to stream management, networking, and platform-specific abstractions (e.g., AudioStream.c, Connection.c, VideoStream.c) [3]. The GitHub user qiin2333 maintains forks (e.g., moonlight-vplus and moonlight-qt) that include modifications related to cursor handling [4][5][6]. Specifically, the repository qiin2333/moonlight-vplus includes a CursorServiceManager.java file, which was introduced to manage cursor operations, but this is a Java/Kotlin component for the Android client, not a C file within the common library [4][6]. The git hash provided (7bfa0c1e79d55871c519287c441a629b9eeed045) does not correspond to any known commit in the official moonlight-stream/moonlight-common-c repository or major associated forks. It appears to be an unrelated alphanumeric string, potentially resembling a truncated blockchain transaction ID [7][8][9].

Citations:


修复缺失的 moonlight-common-c 子模块提交。

当前环境无法获取 7bfa0c1e79d55871c519287c441a629b9eeed045,该 gitlink 会导致 nativelib/src/main/cpp/CMakeLists.txt 引用的 ${MOONLIGHT_COMMON_PATH}/src/CursorStream.c 无法被解析和编译。重新指向可用的 qiin2333/moonlight-common-c 提交,并确认该版本包含 CursorStream.c、符号接口与原有 ArkTS 原生桥接兼容。

🤖 Prompt for 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.

In `@nativelib/src/main/cpp/moonlight-common-c` at line 1, 更新 moonlight-common-c
子模块的 gitlink,替换当前不可获取的提交为 qiin2333/moonlight-common-c 中可用且包含 CursorStream.c
的提交;确认其符号接口与现有 CMakeLists.txt 及 ArkTS 原生桥接兼容。

Source: Path instructions

@qiin2333
qiin2333 merged commit ffb7f08 into master Jul 31, 2026
2 checks passed
@qiin2333
qiin2333 deleted the codex/three-finger-ime-toggle branch July 31, 2026 03:34
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