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

sis和mac上鼠须管的协同问题 #44

Closed
whjiang opened this issue Feb 21, 2022 · 4 comments
Closed

sis和mac上鼠须管的协同问题 #44

whjiang opened this issue Feb 21, 2022 · 4 comments

Comments

@whjiang
Copy link

whjiang commented Feb 21, 2022

中文输入后,切到Normal mode,再切回到insert mode时,鼠须管会是英文输入,要多按下SHIFT才能切成中文。用搜狗作为中文输入就没有这个问题。

rime/squirrel#85rime/squirrel#179 (comment) 来看,是RIME和MAC的兼容性问题。

看emacs-rime是通过定义

(defun rime--inline-ascii ()
  "Toggle inline ascii."
  (let ((key-code
         (cl-case rime-inline-ascii-trigger
           (shift-l 65505)
           (shift-r 65506)
           (control-l 65507)
           (control-r 65508)
           (alt-l 65513)
           (alt-r 65514))))
    (rime-lib-process-key key-code 0)
    (rime-lib-process-key key-code 1073741824)))

在切换到rime后,向rime发送shift键来切换回中文。

不知道SIS是不是可以做类似的事情,向鼠须管发送shift键,来自动切换回中文。

@laishulu
Copy link
Owner

laishulu commented Feb 21, 2022

不行,没办法直接调用rime-lib。

emacs-rime是自己带了rime-lib。

不过,也有个绕过去的方法:
rime/squirrel#221

@fu123456
Copy link

中文输入后,切到Normal mode,再切回到insert mode时,鼠须管会是英文输入,要多按下SHIFT才能切成中文。用搜狗作为中文输入就没有这个问题。

rime/squirrel#85rime/squirrel#179 (comment) 来看,是RIME和MAC的兼容性问题。

看emacs-rime是通过定义

(defun rime--inline-ascii ()
  "Toggle inline ascii."
  (let ((key-code
         (cl-case rime-inline-ascii-trigger
           (shift-l 65505)
           (shift-r 65506)
           (control-l 65507)
           (control-r 65508)
           (alt-l 65513)
           (alt-r 65514))))
    (rime-lib-process-key key-code 0)
    (rime-lib-process-key key-code 1073741824)))

在切换到rime后,向rime发送shift键来切换回中文。

不知道SIS是不是可以做类似的事情,向鼠须管发送shift键,来自动切换回中文。

我也遇到类似的问题,就是使用C-\切换到中文输入法的时候,还需要再按下Shift才可以正确切换到中文输入。我使用的是emacs-mac 29.

@laishulu
Copy link
Owner

这个思路:
sis-change-hook 加一个函数,
如果sis-get命令返回值是sis-other-source
你就用rime-lib-process-key发一个key-code。
你可以自己试一下,
结果反馈到这里来,也能帮到其他人。

@fu123456
Copy link

有配置代码吗?

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