rime / squirrel

【鼠鬚管】Rime for macOS
https://rime.im
GNU General Public License v3.0
4.65k stars 412 forks source link

vim_mode doesn't works for emacs #625

Open linchen2chris opened 2 years ago

linchen2chris commented 2 years ago

I add

patch:
  app_options:
    com.jetbrains.intellij:
      ascii_mode: true
      vim_mode: true
    org.gnu.Emacs:
      ascii_mode: true
      vim_mode: true

in squirrel.custom.yaml, vim_mode works for intellij, but not works for emacs.

qinxiao1990 commented 1 year ago

I've got the same problem -- is there a fix for it? I'm using emacs-plus@28.2. Thanks!

ksqsf commented 11 months ago

This is likely Emacs's fault. The keydown events for ESC are consumed by emacs and, IIUC, will not be sent to Squirrel. See: https://github.com/emacs-mirror/emacs/blob/a1abb6a85e6605c256595b8d7b885018e5421c28/src/nsterm.m#L6848

For prosperity:

ESC keydown event is: keyDown: code =ff1b fnKey =ff1b flags = 100 mods = 0