Last active
August 18, 2025 03:16
-
-
Save lotem/2981316 to your computer and use it in GitHub Desktop.
使用 Control 鍵切換中西文,上屏已輸入的編碼;令 Caps Lock 改變字母的大小寫
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 中西文切換鍵的默認設置寫在 default.yaml 裏面 | |
# 以下的 default.custom.yaml 在全局範圍重定義該組快速鍵 | |
# | |
# 可用的按鍵有 Caps_Lock, Shift_L, Shift_R, Control_L, control_R | |
# Mac 系統上的鼠鬚管不能區分左、右,因此只有對 Shift_L, Control_L 的設定起作用 | |
# | |
# 已輸入編碼時按切換鍵,可以進一步設定輸入法中西文切換的形式。 | |
# 可選的臨時切換策略有三: | |
# inline_ascii 在輸入法的臨時西文編輯區內輸入字母、數字、符號、空格等,回車上屏後自動復位到中文 | |
# commit_text 已輸入的候選文字上屏並切換至西文輸入模式 | |
# commit_code 已輸入的編碼字符上屏並切換至西文輸入模式 | |
# 設爲 noop,屏蔽該切換鍵 | |
# | |
# 如果要把 Caps Lock 設爲只改變字母的大小寫而不做中西文切換,可將 Caps_Lock 對應的切換方式設爲 noop | |
# 如果要以 Caps Lock 切換到西文模式,默認輸出小寫字母,請置 ascii_composer/good_old_caps_lock: false | |
# 如果要以 Caps Lock 切換到西文模式,默認輸出大寫字母,請使用以下設置: | |
patch: | |
ascii_composer/good_old_caps_lock: true | |
ascii_composer/switch_key: | |
Caps_Lock: commit_code | |
Shift_L: noop | |
Shift_R: noop | |
Control_L: commit_code | |
Control_R: commit_code |
就這樣的,先後兩次按鍵輸入成對兒的符號。
如何才能设置为 Alt+Shift 切换中英文,我尝试了下面两种方式都不行:
ascii_composer:
good_old_caps_lock: true # true | false
switch_key:
Caps_Lock: clear # commit_code | commit_text | clear
Shift_L: noop # commit_code | commit_text | inline_ascii | clear | noop
Shift_R: noop # commit_code | commit_text | inline_ascii | clear | noop
Control_L: noop # commit_code | commit_text | inline_ascii | clear | noop
Control_R: noop # commit_code | commit_text | inline_ascii | clear | noop
Alt_L+Shift_L: commit_code
key_binder:
bindings:
- { when: always, toggle: ascii_mode, accept: Alt+Shift } # 切换中英
- { when: always, toggle: ascii_mode, accept: Alt_L+Shift } # 切换中英
Alt+Shift 切换中英文
沒有這個選項。
因爲 Alt+Shift 不是單個事件,要追蹤四個事件。
我平时会隐藏任务栏,看不到状态指示器,之前的 Toggle
模式,每次都得先确认当前处于什么模式,我目前的方案能用一个按钮来直接切换输入法状态:
- 按住 Shift:切换到英文模式
- 按住 Ctrl:切换到中文模式
ascii_composer:
good_old_caps_lock: false
switch_key:
Caps_Lock: commit_code # 已输入字符上屏,同时切换模式
Shift_L: noop
Shift_R: noop
Control_L: noop
Control_R: noop
key_binder:
bindings:
# 长按 Shift 切换到英文状态,为避免和快捷键冲突使用右侧按键
- { when: always, accept: Shift+Shift_R, set_option: ascii_mode }
# 长按 Control 切换到中文状态
- { when: always, accept: Control+Control_R, unset_option: ascii_mode }
如果 librime 1.14.0 新增了
set/unset_ascii_mode
切换功能更新到小狼毫上之后,就更爽了
Shift+Shift_R
這個鍵值不僅單擊 Shift 會觸發,組合輸入上檔文字應該也會觸發,如果不用右 Shift 輸入左邊的大寫字母和符號,可以先將就將就。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
那如何设置为成对出现?