osfans / trime

同文安卓輸入法平臺3.x/Android-rime/Rime Input Method Engine for Android
http://osfans.github.io/trime/
GNU General Public License v3.0
3.09k stars 372 forks source link

`preset_keys` 中自定义按键的 `text` 标签失效 #1208

Closed Wenti-D closed 8 months ago

Wenti-D commented 8 months ago

Describe the bug 按下 Return 键,输入码出现「Return」,而不是发送回车。

To Reproduce Steps to reproduce the bug:

Expected behavior 应当发送回车。

Log If applicable, add crash log to quick focus your problem.

Screenshots image

Smartphone (please complete the following information):

goofyz commented 8 months ago

你檢查一下主題的 android_preset_keys 有沒有 Return

Wenti-D commented 8 months ago

发现问题可能出在处理组合键的逻辑中,仓库 Wiki 里《trime.yaml 详解》第五节 preset_keys 中有:

例 5: 自定义组合键

使用text可以实现一些比较复杂的操作 比如: overwrite: { text: "{Control+a}{Control+v}", label: 覆盖 }

我的 Return 按键采用了这样的操作:

Return: {label: '↵', repeatable: true, text: "{Return}{Eisu_toggle}"}

但是似乎失效了?

nopdan commented 8 months ago

可能是 #1202 引入的 bug,我会查看

Wenti-D commented 8 months ago

测试了一下,在 preset_keys 中写下:

Return: {label: '↵', send: Return}
Return1: {label: '↵', repeatable: true, send: Return}
Return2: {label: '↵', repeatable: true, text: "{Return1}{Eisu_toggle}"}

结果

所以应该是组合键失效了。

goofyz commented 8 months ago

你試試轉回預設的 trime 主題看看是否正常

Wenti-D commented 8 months ago

你試試轉回預設的 trime 主題看看是否正常

是这样的,预设主题的回车键就如我上述所写的 Return 一样,它是正常的,但只要换成内含 text 用于执行组合键操作的标签时就出问题了。

这样看来议题标题得改(

Wenti-D commented 8 months ago

新现象,我自定义的键 Transform: {text: "_", label: '゛゜ぁ'} 会把「Transform」送到输入码,改成 Transform: {send: "_", label: '゛゜ぁ'} 则不会,但下划线送了两次。

goofyz commented 8 months ago

我的鍵 has_menu: "{Return1}5" 也會 crash,排查了一會,是在 has_menu: "{Return1}5" a650fcb80627539c8074bc6304994869387df36e 後才出現。 將 Event.kt 變回 Event.java 就沒事兒了。未找到確切原因。