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

符号配对应该怎么配 #157

Open
huo-feng-ding opened this issue Oct 15, 2024 · 4 comments
Open

符号配对应该怎么配 #157

huo-feng-ding opened this issue Oct 15, 2024 · 4 comments

Comments

@huo-feng-ding
Copy link

huo-feng-ding commented Oct 15, 2024

比如说我想打个双引号 “ , 一般情况下双引号是成对出现的,我想在打一个双引号的时候,自动将后边的双引号补全,补全之后当前的光标是在两个引号之间。 类似成对出现的符号有小括号,中括号,大括号,单引号,书名号之类的

@bczhc
Copy link

bczhc commented Oct 15, 2024

据我目前知识,貌似不行。作者以前也回复过说不支持移动到中间。

rime中没有与前端移动光标等API对接,rime/rime-lua中虽可以发送{Left}按键,但仅是对rime在接管输入上下文时才起作用,比如在composing时发送左键可以移动preedit中的caret。当你按下左键时,Rime仅是通知前端“放行按键事件,让系统处理”,而Rime本身自己无法主动发送一个左键。

但非要说也不是没法,比如我在Linux上就能通过lua中os.execute来执行xdotool,来发送系统按键,比如退格,左键等。Windows下理论也能一样做到……

@huo-feng-ding
Copy link
Author

感谢您的答复

@eko5624
Copy link

eko5624 commented Oct 17, 2024

可以参考他这个方案。
https://github.com/boomker/rime-fast-xhup/blob/main/lua/pair_symbols.lua

@huo-feng-ding
Copy link
Author

@eko5624 感谢答复。
试了一下,在windows下效果不是很好,还是先放弃了。
我先用ahk来简单的实现一下吧

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

3 participants