Closed scturtle closed 3 months ago
看了下 librime 的代码,似乎是 AsciiComposer::ProcessKeyEvent
只识别特定按键序列才调用 ToggleAsciiModeWithKey
。
找到办法了,用 lua 监听一下 set_option ascii_mode 事件然后上屏。
local f = {}
function f.init(env)
context = env.engine.context
context.option_update_notifier:connect(function(ctx, name)
if name == "ascii_mode" and ctx:get_option("ascii_mode") then
context:clear_non_confirmed_composition()
context:commit()
end
end)
end
return f
簡要描述 Bug:
default.custom.yaml
配置:当用中文输入若干字符之后:
用快捷键触发 set_option ascii_mode 切换到英文:
会保留 inline_preedit 状态,此时需要回车才会上屏:
且配置了 ascii_composer 中相同的快捷键也无效。
預期行爲:
可控制 set_option ascii_mode 时上屏。
實際行爲:
无法控制 set_option ascii_mode 时是否上屏,保留 inline_preedit 状态。
環境
我試過:
朙月拼音
)後問題仍存在