Skip to content

feat(client): 添加 Windows IME 自动控制功能#36

Open
XSana wants to merge 1 commit into
masterfrom
feature/ime-control-v2
Open

feat(client): 添加 Windows IME 自动控制功能#36
XSana wants to merge 1 commit into
masterfrom
feature/ime-control-v2

Conversation

@XSana

@XSana XSana commented Jan 4, 2026

Copy link
Copy Markdown
Owner
  • 游戏内无 GUI 时自动禁用输入法,防止 WASD 等按键被拦截
  • 打开 GUI 时自动启用输入法,方便输入中文
  • 通过 JNA 调用 Windows IMM32 API 实现
  • 添加配置项 enableIMEControl 可开关此功能
  • 仅在 Windows 系统上生效

- 游戏内无 GUI 时自动禁用输入法,防止 WASD 等按键被拦截
- 打开 GUI 时自动启用输入法,方便输入中文
- 通过 JNA 调用 Windows IMM32 API 实现
- 添加配置项 enableIMEControl 可开关此功能
- 仅在 Windows 系统上生效

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9bf324117a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread dependencies.gradle
Comment on lines 43 to +46
dependencies {
// JNA for Windows IME control
// shadowImplementation('net.java.dev.jna:jna:5.14.0')
// shadowImplementation('net.java.dev.jna:jna-platform:5.14.0')
shadowImplementation('net.java.dev.jna:jna:5.14.0')
shadowImplementation('net.java.dev.jna:jna-platform:5.14.0')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid relocating JNA to keep IME control working

JNA was added as shadowImplementation here while gradle.properties now enables shadowed dependencies with relocation (lines 111‑119). ShadowImplementation relocates classes to a renamed package, but JNA hardcodes the /com/sun/jna/... resource path when loading its jnidispatch native, so relocating it prevents the native library from being found. On Windows builds this yields an UnsatisfiedLinkError during Native.load, causing IMEControl.init() to log a failure and the IME handler never registers, so the new IME auto-control never works. Please either keep JNA unshadowed or exclude it from relocation.

Useful? React with 👍 / 👎.

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