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

【咨询】能否在“后台”特定窗口激活的情况下,恢复到设定英文或中文输入状态 #1438

Open
komazhou opened this issue Nov 24, 2024 · 0 comments

Comments

@komazhou
Copy link

komazhou commented Nov 24, 2024

已知可以在weasel.custom.yaml中配置特定程序使用英文状态,例如:
app_options:
listary.exe:
ascii_mode: true
**但能否在rime中直接实现——在特定程序(如totalcmd.exe)中,每次激活之后都恢复到英文输入状态,**具体的逻辑是:
在totalcmd窗口中,切换到中文输入状态,修改文件名等操作,只要不跳出totalcmd窗口,此时的输入状态全部为中文输入状态;
切换到其他窗口,然后在切换回totalcmd之后,无论上次的输入状态是什么,都会切换回英文输入状态。

目前的实现方式:
先在key_binder/bindings中设置 - {when: always, accept: Control+Shift+Alt+E, set_option: ascii_mode}
通过ahk代码,在每次鼠标点击的情况下,先判断激活窗口是否变化,如果有变化,就判断当前窗口是否是totalcmd.exe,如果是,就发送快捷键将rime切换到ascii_mode。

更新实现方式:
得益于最新的命令行参数,无需设置切换快捷键
在ahk脚本中,直接命令行設置小狼毫 ascii_mode 狀態WeaselServer.exe /ascii

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

No branches or pull requests

1 participant