laishulu/emacs-smart-input-source

When switching meow mode, could sis switch the Chinese and English input methods accordingly?

Prague2049 opened this issue · 1 comments

When switching meow mode, could sis switch the Chinese and English input methods accordingly?
Is it possible to enter insert mode of meow when pressing the i key and the rime input method is Chinese?
Is it the English input method for rime when pressing the ESC key to enter kaypad mode?

roife commented
(defvar meow-leave-insert-mode-hook nil
  "Hook to run when leaving meow insert mode.")
(defvar meow-enter-insert-mode-hook nil
  "Hook to run when entering meow insert mode.")
(add-hook! meow-insert-mode-hook
  (defun +meow-insert-mode-run-hook-on-mode ()
    (run-hooks
     (if meow-insert-mode 'meow-enter-insert-mode-hook
       'meow-leave-insert-mode-hook))
    )
  )

;; ...

  (add-hook 'meow-leave-insert-mode-hook #'sis-set-english)
  (add-to-list 'sis-context-hooks 'meow-enter-insert-mode-hook)