Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复禁止切换中英文后,无法在 Chrome 浏览器中使用快捷键的问题 #141

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

qwertyyb
Copy link
Owner

No description provided.

@qwertyyb
Copy link
Owner Author

qwertyyb commented Dec 1, 2024

出现此问题的原因是,当按下功能键(shift、command、ctrl、option 等) + 普通按键(a、b、c、1、2、3 等)时,功能键和普通键预期应该全部被放过,即输入法不处理交由操作系统处理,更具体的说,InputController.handle 方法应该返回 false。然而实际上却是,功能键虽然被放过交由了操作系统,而普通按键被输入法当成了普通字符输入,比如 Command+A 的 A 键被输入法处理,操作系统由此识别快捷键出现问题。
解决方法为,输入法从最小使用出发,只处理需要处理的按键或按键组合,其他不需要处理的全部交由操作系统,具体如下:

  1. 针对所有输入法不需要处理的功能键,全部放过交给操作系统处理。
  2. 针对所有输入法不需要处理的功能键和普通按键组合,也交由操作系统处理。

P.S.
目前输入法处理的功能键有:

  1. 方向键,用以处理上下翻页(横向时,上下键翻页,竖向时左右键翻页)
  2. ctrl + 数字键,用以把某一个候选项置顶

@qwertyyb
Copy link
Owner Author

qwertyyb commented Dec 3, 2024

close #132

@qwertyyb qwertyyb merged commit 1f00d65 into master Dec 3, 2024
4 checks passed
@qwertyyb qwertyyb deleted the fix/disable-toggle-mode branch December 3, 2024 11:02
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