Native & OS 输入法管理包『sis』使用交流

M-S-RETC-S-RET 分别映射到了什么函数?

C-S-<return> runs the command
org-insert-todo-heading-respect-content (found in
org-mode-map), which is an interactive byte-compiled Lisp
function in ‘org.el’.

It is bound to C-S-<return>.
M-S-<return> runs the command org-insert-todo-heading (found
in org-mode-map), which is an interactive byte-compiled Lisp
function in ‘org.el’.

It is bound to M-S-<return> and M-S-RET.

我观察到按M-S-RET的时候执行的是切换而不是切换至英文,可能和输入法的shift切换有关。

你要有需求的话,就自定义 sis-context-triggers这个变量。

('+org/insert-item-below 'sis--context-line nil)

意思是,在'+org/insert-item-below函数执行前后,分别用你指定的函数来检测上下文,nil的话让检测链上后面的函数去决定,非nil的话就确定你想切换到什么输入法。本例中,在函数'+org/insert-item-below 执行前用'sis--context-line 检测上下文,'+org/insert-item-below 执行后不检测。

1 个赞

找到问题所在了,可能是输入法为了适配C-S-<tab>的快捷键,对于C-S一律忽略掉其中的Shift,而没有对M-S进行同样的处理,导致当我按下M-S-<return>的时候,先触发emacs内置函数,松开Shift之后输入法识别为一次长按Shift的过程,触发输入法内置的中英文状态切换快捷键。

解决方法也很简单,关掉输入法内置的Shift,改用Windows内置的Ctrl+Space切换中英文状态。

更新了新版的 Squirrel 也就是 Mac 上的 rime,现在有个问题必现,在我设定的 mode 中进入 meow 的 insert-mode 自动切换到中文,在一个 buffer 中,第一次切换是成功的,然后退出到 meow 的 normal-mode 再次进入 insert-mode 后就会还是英文输入法,但是 menu-bar 上的图标是 Squirrel。

macism 偶尔切换失败的问题,就是 menu bar 上输入法 icon 在中英文间反复横跳的问题。我改了一个版本,感觉没啥问题了。

func select() {
        let currentSource = InputSourceManager.getCurrentSource()
        if currentSource.id == self.id {
            return
        }
        
        TISSelectInputSource(tisInputSource)
        usleep(InputSourceManager.uSeconds)
        
        if self.isCJKV {
            if let nonCJKV = InputSourceManager.nonCJKVSource() {
                TISSelectInputSource(nonCJKV.tisInputSource)
                usleep(InputSourceManager.uSeconds)
                
                let newCurrentSource = InputSourceManager.getCurrentSource()
                if newCurrentSource.id == nonCJKV.id {
                    InputSourceManager.selectPrevious()
                } else {
                    TISSelectInputSource(tisInputSource)
                }
            }
        }
    }

我也提了 pr 了 Fix issue where the intended switch to Chinese input method defaults to English after multiple toggles by LuciusChen · Pull Request #17 · laishulu/macism · GitHub 用了两天没有失误的情况出现。