Last active
April 21, 2026 06:39
-
-
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 |
Author
话说我想覆盖左右 Shift,实现左边中文右边英文,但不生效
patch: key_binder/bindings/+: - { when: always, accept: Shift_L, unset_option: ascii_mode } - { when: always, accept: Shift_R, set_option: ascii_mode }這樣設置不行。Shift 按下之後也可能跟別的鍵組合,需要檢測 shift 鍵單擊。
patch: ascii_composer/switch_key/+: Shift_L: unset_ascii_mode Shift_R: set_ascii_mode
我试了,但好像不起作用,这里附上我 build 完后的 default.yaml
default.yaml
__build_info:
rime_version: 1.13.1
timestamps:
default: 1749012324
default.custom: 1774434932
key_bindings: 1749012324
key_bindings.custom: 0
punctuation: 1749012323
punctuation.custom: 0
ascii_composer:
good_old_caps_lock: true
switch_key:
Caps_Lock: clear
Control_L: noop
Control_R: noop
Eisu_toggle: clear
Shift_L: unset_ascii_mode
Shift_R: set_ascii_mode
config_version: 0.40
key_binder:
bindings:
- {accept: "Control+p", send: Up, when: composing}
- {accept: "Control+n", send: Down, when: composing}
- {accept: "Control+b", send: Left, when: composing}
- {accept: "Control+f", send: Right, when: composing}
- {accept: "Control+a", send: Home, when: composing}
- {accept: "Control+e", send: End, when: composing}
- {accept: "Control+d", send: Delete, when: composing}
- {accept: "Control+k", send: "Shift+Delete", when: composing}
- {accept: "Control+h", send: BackSpace, when: composing}
- {accept: "Control+g", send: Escape, when: composing}
- {accept: "Control+bracketleft", send: Escape, when: composing}
- {accept: "Control+y", send: Page_Up, when: composing}
- {accept: "Alt+v", send: Page_Up, when: composing}
- {accept: "Control+v", send: Page_Down, when: composing}
- {accept: ISO_Left_Tab, send: "Shift+Left", when: composing}
- {accept: "Shift+Tab", send: "Shift+Left", when: composing}
- {accept: Tab, send: "Shift+Right", when: composing}
- {accept: minus, send: Page_Up, when: has_menu}
- {accept: equal, send: Page_Down, when: has_menu}
- {accept: comma, send: Page_Up, when: paging}
- {accept: period, send: Page_Down, when: has_menu}
- {accept: "Control+Shift+1", select: .next, when: always}
- {accept: "Control+Shift+2", toggle: ascii_mode, when: always}
- {accept: "Control+Shift+3", toggle: full_shape, when: always}
- {accept: "Control+Shift+4", toggle: simplification, when: always}
- {accept: "Control+Shift+5", toggle: extended_charset, when: always}
- {accept: "Control+Shift+exclam", select: .next, when: always}
- {accept: "Control+Shift+at", toggle: ascii_mode, when: always}
- {accept: "Control+Shift+numbersign", toggle: full_shape, when: always}
- {accept: "Control+Shift+dollar", toggle: simplification, when: always}
- {accept: "Control+Shift+percent", toggle: extended_charset, when: always}
- {accept: KP_Enter, send: Return, when: composing}
- {accept: "Control+Shift+F", toggle: traditionalization, when: always}
menu:
page_size: 5
punctuator:
digit_separator_action: commit
full_shape:
" ": {commit: " "}
"!": {commit: "!"}
"\"": {pair: ["“", "”"]}
"#": ["#", "⌘"]
"$": ["¥", "$", "€", "£", "¥", "¢", "¤"]
"%": ["%", "°", "℃"]
"&": "&"
"'": {pair: ["‘", "’"]}
"(": "("
")": ")"
"*": ["*", "·", "・", "×", "※", "❂"]
"+": "+"
",": {commit: ","}
"-": "-"
.: {commit: "。"}
"/": ["/", "÷"]
":": {commit: ":"}
";": {commit: ";"}
"<": ["《", "〈", "«", "‹"]
"=": "="
">": ["》", "〉", "»", "›"]
"?": {commit: "?"}
"@": ["@", "☯"]
"[": ["「", "【", "〔", "["]
"\\": ["、", "\"]
"]": ["」", "】", "〕", "]"]
"^": {commit: "……"}
_: "——"
"`": "`"
"{": ["『", "〖", "{"]
"|": ["·", "|", "§", "¦"]
"}": ["』", "〗", "}"]
"~": "~"
half_shape:
"!": {commit: "!"}
"\"": {pair: ["“", "”"]}
"#": "#"
"$": ["¥", "$", "€", "£", "¥", "¢", "¤"]
"%": ["%", "%", "°", "℃"]
"&": "&"
"'": {pair: ["‘", "’"]}
"(": "("
")": ")"
"*": ["*", "*", "·", "・", "×", "※", "❂"]
"+": "+"
",": {commit: ","}
"-": "-"
.: {commit: "。"}
"/": ["、", "/", "/", "÷"]
":": {commit: ":"}
";": {commit: ";"}
"<": ["《", "〈", "«", "‹"]
"=": "="
">": ["》", "〉", "»", "›"]
"?": {commit: "?"}
"@": "@"
"[": ["「", "【", "〔", "["]
"\\": ["、", "\\", "\"]
"]": ["」", "】", "〕", "]"]
"^": {commit: "……"}
_: "——"
"`": "`"
"{": ["『", "〖", "{"]
"|": ["·", "|", "|", "§", "¦"]
"}": ["』", "〗", "}"]
"~": ["~", "~"]
recognizer:
patterns:
email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$"
schema_list:
- schema: pinyin_simp
switcher:
abbreviate_options: true
caption: "〔方案選單〕"
fold_options: true
hotkeys:
- F4
option_list_separator: "/"
save_options:
- full_shape
- ascii_punct
- simplification
- extended_charset
- zh_hant
- zh_hans
- zh_hant_tw
Author
@huaxianyan 很抱歉,你現在用的輸入法版本不支持,這個選項是 librime 1.14.0 加入的。可嘗試升級 librime
@huaxianyan 很抱歉,你現在用的輸入法版本不支持,這個選項是 librime 1.14.0 加入的。可嘗試升級 librime
感谢解惑,我尝试一下
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
這樣設置不行。Shift 按下之後也可能跟別的鍵組合,需要檢測 shift 鍵單擊。