Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法覆盖默认快捷键 #718

Closed
RoyRao2333 opened this issue Feb 3, 2023 · 8 comments
Closed

无法覆盖默认快捷键 #718

RoyRao2333 opened this issue Feb 3, 2023 · 8 comments

Comments

@RoyRao2333
Copy link

以下是我的快捷键绑定:

image

如图所示,原先default.custom.yamlCtrl + Shift + 4简繁切换,现在我的Ctrl + Shift + 4已经改为显示生僻字,但是当我按出快捷键后,依然会显示简繁切换的标识,也就是说我的改动似乎没有生效。(改过的1、2、3快捷键都正常,只有4没有生效)

@lotem
Copy link
Member

lotem commented Feb 4, 2023

請給出配置代碼以便分析。

@RoyRao2333
Copy link
Author

請給出配置代碼以便分析。

default.custom.yaml:

patch:
  schema_list:
    - schema: luna_pinyin_simp # 朙月拼音
    - schema: double_pinyin_flypy # 小鹤双拼
    - schema: double_pinyin # 自然码双拼
    - schema: numbers # 大写数字

  menu/page_size: 9 # 候选词个数

  ascii_composer/good_old_caps_lock: true # 若为 true, Caps 只切换大小写
  
  ascii_composer/switch_key:
    Caps_Lock: commit_code # Caps 键
    Shift_L: commit_code # 左 Shift,切换中英文
    Shift_R: commit_code # 右 Shift,切换中英文
    Control_L: noop # 左 Control,屏蔽该切换键
    Control_R: noop # 右 Control,屏蔽该切换键

  key_binder/bindings:
    # 翻页
    - { when: composing, accept: Tab, send: Shift+Right } # "tab" 键分词
    - { when: paging, accept: minus, send: Page_Up } # "-" 上一页
    - { when: has_menu, accept: equal, send: Page_Down } # "=" 下一页
    - { when: paging, accept: comma, send: Page_Up } # "," 上一页
    - { when: has_menu, accept: period, send: Page_Down } # "." 下一页
    - { when: paging, accept: bracketleft, send: Page_Up } # "[" 上一页
    - { when: has_menu, accept: bracketright, send: Page_Down } # "]" 下一页
    # 快捷键
    - { when: always, accept: Control+Shift+1, toggle: zh_simp } # 繁简体切换
    - { when: always, accept: Control+Shift+2, toggle: full_shape }        # 全角/半角切换
    - { when: always, accept: Control+Shift+3, toggle: show_emoji } # emoji候选切换
    - { when: always, accept: Control+Shift+4, select: .next }

@lotem
Copy link
Member

lotem commented Feb 4, 2023

    - { when: always, accept: Control+Shift+4, select: .next }

這句是在默認快捷鍵裏把 Control+Shift+4 定義爲切換到下一個輸入方案。從這兒看不出什麼問題。測試也沒發現異常。

實際還要看具體輸入方案裏是不是引用了默認快捷鍵設置。
不如檢查編譯完的輸入方案文件 <用戶文件夾>/build/*.schema.yaml ,看看最終在輸入法裏生效的配置。

@RoyRao2333
Copy link
Author

RoyRao2333 commented Feb 4, 2023

@lotem

上传了luna_pinyin_simp.schema.yaml

感谢大佬的提醒,看了这个文件,发现确实Ctrl + Shift + 4重复了,但是请问这个如何修复呢?感谢!

@lotem
Copy link
Member

lotem commented Feb 5, 2023

当然得把后面那条快捷键定义去掉

@lotem lotem closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2023
@RoyRao2333
Copy link
Author

@lotem

感谢大佬,成功解决了 🎉

因为在build目录,我还以为去掉后重新deploy又会出现,但实测deploy后没有问题,看来应该之前有某种bug。✌🏻

@lotem
Copy link
Member

lotem commented Feb 5, 2023

不是。肯定在其他文件里有定义。

@RoyRao2333
Copy link
Author

@lotem

确实的,我发现非build目录下的luna_pinyin_simp.schema.yaml里写有这个错误的binding,应该是覆写了default.custom.yaml 😂

这里我有个疑问,就是key_binder/bindings设置应该写在*.schema.yaml还是*.custom.yaml中呢?因为以上两个文件后缀不同,不知道哪个写错了位置。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants