VocoType-linux icon indicating copy to clipboard operation
VocoType-linux copied to clipboard

[bug]在fcitx5中州韵下,不能触发f9快捷键

Open yjlc-pc opened this issue 5 months ago • 4 comments

系统信息

操作系统

操作系统: Fedora Linux 44 KDE Plasma 版本: 6.7.1 KDE 程序框架版本: 6.27.0 Qt 版本: 6.11.1 内核版本: 7.0.13-200.fc44.x86_64 (64 位) 图形平台: Wayland 处理器: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz 内存: 16 GiB 内存 (15.4 GiB 可用) 图形处理器: Intel® Iris® Xe Graphics 制造商: HUAWEI 产品名称: BDZ-WXX9 系统版本: M1020

Fcitx版本

5.1.19

Rime配置

# Rime default settings
# encoding: utf-8


# 要比共享目录的同名文件的 config_version 大才可以生效
config_version: '2024-07-12'


# 方案列表
schema_list:
  # 可以直接删除或注释不需要的方案,对应的 *.schema.yaml 方案文件也可以直接删除
  - schema: rime_frost             # 白霜拼音(全拼)
  - schema: rime_frost_double_pinyin          # 自然码双拼
  - schema: rime_frost_double_pinyin_mspy     # 微软双拼
  - schema: rime_frost_double_pinyin_sogou    # 搜狗双拼
  - schema: rime_frost_double_pinyin_flypy    # 小鹤双拼
  # - schema: rime_frost_double_pinyin_abc      # 智能 ABC 双拼
  # - schema: rime_frost_double_pinyin_ziguang  # 紫光双拼


# 菜单
menu:
  page_size: 8  # 候选词个数
  # alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ]  # 修改候选项标签
  # alternative_select_keys: ASDFGHJKL  # 如编码字符占用数字键,则需另设选字键


# 方案选单相关
switcher:
  caption: 「方案选单」
  hotkeys:
    - F4
    - Control+grave
    - Control+Shift+grave
    # - Alt+grave
  save_options:  # 开关记忆(方案中的 switches),从方案选单(而非快捷键)切换时会记住的选项,需要记忆的开关不能设定 reset
    - ascii_punct
    - traditionalization
    - emoji
    - full_shape
    - search_single_char
  fold_options: true            # 呼出时是否折叠,多方案时建议折叠 true ,一个方案建议展开 false
  abbreviate_options: true      # 折叠时是否缩写选项
  option_list_separator: ' / '  # 折叠时的选项分隔符


# 中西文切换
#
# good_old_caps_lock:
# true   切换大写
# false  切换中英
# macOS 偏好设置的优先级更高,如果勾选【使用大写锁定键切换“ABC”输入法】则始终会切换输入法。
#
# 切换中英:
# 不同的选项表示:打字打到一半时按下了 CapsLock、Shift、Control 后:
# commit_code  上屏原始的编码,然后切换到英文
# commit_text  上屏拼出的词句,然后切换到英文
# clear        清除未上屏内容,然后切换到英文
# inline_ascii 切换到临时英文模式,按回车上屏后回到中文状态
# noop         屏蔽快捷键,不切换中英,但不要屏蔽 CapsLock
ascii_composer:
  good_old_caps_lock: true  # true | false
  switch_key:
    Caps_Lock: clear      # commit_code | commit_text | clear
    Shift_L: commit_code  # 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


###################################################################################


# 下面的 punctuator recognizer key_binder 写了一些所有方案通用的配置项。
# 写在 default.yaml 里,方便多个方案引用,就是不用每个方案都写一遍了。


# 标点符号
# 设置为一个映射,就自动上屏;设置为多个映射,如 '/' : [ '/', ÷ ] 则进行复选。
#   full_shape: 全角没改,使用预设值
#   half_shape: 标点符号全部直接上屏,和 macOS 自带输入法的区别是
#              '|' 是半角的,
#              '~' 是半角的,
#              '`'(反引号)没有改成 '·'(间隔号)。
punctuator:
  full_shape:
    ' ' : { commit: ' ' }
    ',' : { commit: , }
    '.' : { commit: 。 }
    '<' : [ 《, 〈, «, ‹ ]
    '>' : [ 》, 〉, », › ]
    '/' : [ /, ÷ ]
    '?' : { commit: ? }
    ';' : { commit: ; }
    ':' : { commit: : }
    '''' : { pair: [ '‘', '’' ] }
    '"' : { pair: [ '“', '”' ] }
    '\' : [ 、, \ ]
    '|' : [ ·, |, '§', '¦' ]
    '`' : `
    '~' : ~
    '!' : { commit: ! }
    '@' : [ @, ☯ ]
    '#' : [ #, ⌘ ]
    '%' : [ %, '°', '℃' ]
    '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ]
    '^' : { commit: …… }
    '&' : &
    '*' : [ *, ·, ・, ×, ※, ❂ ]
    '(' : (
    ')' : )
    '-' : -
    '_' : ——
    '+' : +
    '=' : =
    '[' : [ 「, 【, 〔, [ ]
    ']' : [ 」, 】, 〕, ] ]
    '{' : [ 『, 〖, { ]
    '}' : [ 』, 〗, } ]
  half_shape:
    ',' : ','
    '.' : '。'
    '<' : '《'
    '>' : '》'
    '/' : [ /, ÷ ]
    '?' : '?'
    ';' : ';'
    ':' : ':'
    '''' : { pair: [ '‘', '’' ] }
    '"' : { pair: [ '“', '”' ] }
    '\' : '、'
    '|' : '|'
    '`' : '`'
    '~' : '~'
    '!' : '!'
    '@' : '@'
    '#' : '#'
    '%' : '%'
    '$' : '¥'
    '^' : '……'
    '&' : '&'
    '*' : '*'
    '(' : '('
    ')' : ')'
    '-' : '-'
    '_' : ——
    '+' : '+'
    '=' : '='
    '[' : '【'
    ']' : '】'
    '{' : '「'
    '}' : '」'


# 处理符合特定规则的输入码,如网址、反查
# 此处配置较为通用的选项,各方案中另增加了和方案功能绑定的 patterns。
recognizer:
  patterns:
    email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"                            # email @ 之后不上屏
    url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$"  # URL
    underscore: "^[A-Za-z]+_.*"  # 下划线不上屏


# 快捷键
key_binder:
  # Lua 配置: 以词定字(上屏当前词句的第一个或最后一个字),和中括号翻页有冲突
  select_first_character: "bracketleft"  # 左中括号 [
  select_last_character: "bracketright"  # 右中括号 ]

  bindings:
    # Tab / Shift+Tab 切换光标至下/上一个拼音
    - { when: composing, accept: Shift+Tab, send: Shift+Left }
    - { when: composing, accept: Tab, send: Shift+Right }
    # Tab / Shift+Tab 翻页
    # - { when: has_menu, accept: Shift+Tab, send: Page_Up }
    # - { when: has_menu, accept: Tab, send: Page_Down }

    # Option/Alt + ←/→ 切换光标至下/上一个拼音
    - { when: composing, accept: Alt+Left, send: Shift+Left }
    - { when: composing, accept: Alt+Right, send: Shift+Right }

    # 翻页 - =
    - { when: has_menu, 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 }

    # 两种按键配置,鼠须管 Control+Shift+4 生效,小狼毫 Control+Shift+dollar 生效,都写上了。
    # numbered_mode_switch:
    # - { when: always, select: .next, accept: Control+Shift+1 }                  # 在最近的两个方案之间切换
    # - { when: always, select: .next, accept: Control+Shift+exclam }             # 在最近的两个方案之间切换
    # - { when: always, toggle: ascii_mode, accept: Control+Shift+2 }             # 切换中英
    # - { when: always, toggle: ascii_mode, accept: Control+Shift+at }            # 切换中英
    - { when: always, toggle: ascii_punct, accept: Control+Shift+3 }              # 切换中英标点
    - { when: always, toggle: ascii_punct, accept: Control+Shift+numbersign }     # 切换中英标点
    - { when: always, toggle: traditionalization, accept: Control+Shift+4 }       # 切换简繁
    - { when: always, toggle: traditionalization, accept: Control+Shift+dollar }  # 切换简繁
    # - { when: always, toggle: full_shape, accept: Control+Shift+5 }             # 切换全半角
    # - { when: always, toggle: full_shape, accept: Control+Shift+percent }       # 切换全半角

    # emacs_editing:
    # - { when: composing, 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 }

    # optimized_mode_switch:
    # - { when: always, accept: Control+Shift+space, select: .next }
    # - { when: always, accept: Shift+space, toggle: ascii_mode }
    # - { when: always, accept: Control+comma, toggle: full_shape }
    # - { when: always, accept: Control+period, toggle: ascii_punct }
    # - { when: always, accept: Control+slash, toggle: traditionalization }

    # 将小键盘 0~9 . 映射到主键盘,数字金额大写的 Lua 如 R1234.5678 可使用小键盘输入
    - {accept: KP_0, send: 0, when: composing}
    - {accept: KP_1, send: 1, when: composing}
    - {accept: KP_2, send: 2, when: composing}
    - {accept: KP_3, send: 3, when: composing}
    - {accept: KP_4, send: 4, when: composing}
    - {accept: KP_5, send: 5, when: composing}
    - {accept: KP_6, send: 6, when: composing}
    - {accept: KP_7, send: 7, when: composing}
    - {accept: KP_8, send: 8, when: composing}
    - {accept: KP_9, send: 9, when: composing}
    - {accept: KP_Decimal, send: period, when: composing}

方案为白霜拼音

问题现象

在fcitx选择“中州韵”输入法时,按F9无法调出vocotype语音输入。

预期行为

按照readme中的教程配置后,应不用切换输入法即可使用语音输入。

yjlc-pc avatar Jul 02 '26 05:07 yjlc-pc

感谢详细的环境和配置说明。这里确认不是白霜拼音配置本身的问题,而是当前 Fcitx 5 实现的架构限制。

目前 VoCoType 以一个独立的 InputMethodEngine 运行。只有当输入法切换到 VoCoType 时,它才能收到 F9 键事件;当当前输入法是外部的“中州韵”/fcitx5-rime 时,按键由该输入法处理,VoCoType 引擎不会收到 F9。因此,现阶段支持的使用方式是切换到 VoCoType,并使用 VoCoType 内置的 Rime 集成。

要做到“保持任意输入法为当前输入法,F9 都能触发语音输入”,需要把热键与语音入口重构为 Fcitx 5 的全局 module/addon,而不是在现有输入法引擎里补一处按键判断。这属于功能增强,不是简单 bug,所以已将本 issue 标记为 enhancement。

后续版本可能单独支持全局热键/跨输入法触发;对 Fcitx addon 架构熟悉的贡献者也欢迎提交 PR。实现时需要兼顾 Wayland、热键冲突、文本提交到当前 input context,以及现有 VoCoType 输入法模式的兼容性。

LeonardNJU avatar Jul 19 '26 18:07 LeonardNJU

这个问题对应的是旧版 Fcitx 5 架构。当前 master 已改为真正的全局 Category=Module addon:继续使用系统原生的中州韵 / rime-frost,VoCoType 只监听 F9 并向当前输入框提交识别结果,不再要求切换到独立的 VoCoType 输入法。

请先获取最新 master,然后使用推荐的图形化迁移/修复流程:

bash installers/launch-settings.sh

在 VoCoType 设置 → 概览与安装 中点击 安装 / 修复 VoCoType(Fcitx 5)。GUI 会安装全局 module,并清理旧版独立输入法条目。完成后按界面提示重启 Fcitx 5。

随后保持 rime-frost / 中州韵 为当前输入法,直接测试 F9。也可以在 fcitx5-configtool 的附加组件页面确认 VoCoType Voice Input 已启用。

本 issue 保持打开,等待 Fedora 44 + Wayland 实机复测。

LeonardNJU avatar Jul 21 '26 04:07 LeonardNJU

v4.1.0-beta.2 已发布:https://github.com/LeonardNJU/VocoType-linux/releases/tag/v4.1.0-beta.2

这个版本使用当前的 Fcitx 5 全局 Module 架构,不再要求切换到独立的 VoCoType 输入法。保持中州韵 / rime-frost 为当前输入法时,VoCoType Module 应当直接监听已配置的语音快捷键,并把结果提交到当前 input context。

同时,普通识别、AI 润色和语音编辑现在可以分别录制快捷键;默认仍为 F9 / Shift+F9 / Ctrl+F9,也可以改成 Alt_R 等安全组合。

请在 Fedora 44 + Wayland 上安装对应的 Fcitx 5 RPM:

sudo dnf install ./vocotype-linux-fcitx5-4.1.0-0.beta2.fc44.x86_64.rpm

随后保持中州韵为当前输入法,分别测试默认 F9 和一个自定义快捷键。也请在 fcitx5-configtool 的附加组件页面确认 VoCoType Voice Input 已启用。收到你的实机确认前继续保持 Open。

LeonardNJU avatar Jul 23 '26 19:07 LeonardNJU

当前 Fcitx 5 实现已经是全局 Category=Module addon,保持中州韵 / rime-frost 为当前输入法时即可触发 VoCoType,不再需要切换到独立输入法;这正是本 issue 请求的架构行为。

由于超过 7 天没有收到 Fedora 44 + Wayland 的进一步反馈,本 issue 先暂时关闭。若最新版中保持中州韵时仍无法触发,请新建一个 issue,并引用 #29 作为 follow-up,同时附上 Fcitx 版本、VoCoType 版本、addon 启用状态、Doctor 结果和最新 support bundle。

LeonardNJU avatar Aug 02 '26 01:08 LeonardNJU