librime icon indicating copy to clipboard operation
librime copied to clipboard

Rime stay in english mode triggered by cpas lock if switching back under no caps lock

Open wengxt opened this issue 7 months ago • 1 comments

Describe the bug For a RimeSession

  1. Press Caps lock to turn on ascii mode
  2. Swtich to non-rime input method, or unfocus completely
  3. Press caps lock in other input method
  4. Switch back to rime
  5. Current state is English.

To Reproduce It is an issue to fcitx when fcitx keep the session alive all the time. Can be reproduce by switching input method It's also an issue to ibus when caps lock is pressed outside of text box.

Demo with ibus-rime

https://github.com/user-attachments/assets/e91803be-751a-40a5-a6f4-b6b004f148d4

Expected behavior Rime reset the ascii mode, probably via monitor the most recent key event's lock state.

Log N/A

Screenshots N/A

Flavor(please complete the following information): Select your flavor:

  • [ ] ibus-rime
  • [*] fcitx-rime
  • [*] fcitx5-rime
  • [ ] Squirrel
  • [ ] Trime
  • [ ] Weasel

Package:

  • OS: Arch
  • Version: 1.12.0

Additional context ProcessCaps could be improve when caps lock is handled outside of rime.

wengxt avatar May 25 '25 02:05 wengxt

這個現象是實現方法決定的,也不能說是有意爲之。

原因是 librime 把 Caps_Lock 的按鍵事件當成一個「切換」動作,而不是讓 ascii_mode 時時同步 Caps Lock 狀態變化。

也許最初想着:會不會有輸入方案就是要用大寫字母輸入編碼,大寫鎖定狀態也能輸入中文呢,就這樣先決定了他是一個可通過配置啓用的「切換」鍵。可是我自己不用 Caps Lock,所以也想不出這個行爲究竟有沒有用,也沒有關注 Caps Lock 狀態的中文輸入能不能實現。

macOS 又把情況搞複雜了,Caps Lock 不一定用來點亮大寫鎖定。

librime 的 ascii_mode 也有其他方式切換,如按 Shift、按其他自定義的組合鍵、根據 app 自動匹配、由外部程序設置; 在實驗過程最後一刻,大寫鎖定關閉的狀態下,我不太確定要不要讓輸入法自動切回中文,也許目前的狀態是用戶或其他程序主動設置的?

總之就是 librime 採用了非常保守的策略,要等一個明確輸入信號。想要改進,我得多用用 Caps Lock。

lotem avatar Sep 24 '25 06:09 lotem