Steam 及 Steam 工具软件中无法正常使用输入法

一开始我是在 Steam 中的 Godot Engine(下面简称 Godot) 写程序, 发现在 Godot 中可以调用输入法, 但是没法输入中文字符 (注: 官网下载的版本的是可以正常书用输入法的), 后来发现在 Steam 软件中也有问题 (无法调用输入法), 我 ibus 和 fcitx5 都试过了, 上述两处均无法正常使用, 有人有遇到类似的问题吗?怎么解决的?

fcitx5-diagnose 看看先?

# System Info:
1.  `uname -a`:

        Linux debian 6.1.0-30-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.124-1 (2025-01-12) x86_64 GNU/Linux

2.  `lsb_release -a`:

        Distributor ID:	Debian
        Description:	Debian GNU/Linux 12 (bookworm)
        Release:	12
        Codename:	bookworm

3.  `lsb_release -d`:

        Description:	Debian GNU/Linux 12 (bookworm)

4.  `/etc/lsb-release`:

        DISTRIB_ID=Kylin
        DISTRIB_RELEASE=V10
        DISTRIB_CODENAME=kylin
        DISTRIB_DESCRIPTION="Kylin V10 SP1"
        DISTRIB_KYLIN_RELEASE=V10
        DISTRIB_VERSION_TYPE=enterprise
        DISTRIB_VERSION_MODE=normal

5.  `/etc/os-release`:

        PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
        NAME="Debian GNU/Linux"
        VERSION_ID="12"
        VERSION="12 (bookworm)"
        VERSION_CODENAME=bookworm
        ID=debian
        HOME_URL="https://www.debian.org/"
        SUPPORT_URL="https://www.debian.org/support"
        BUG_REPORT_URL="https://bugs.debian.org/"

6.  Desktop Environment:

    Desktop environment is `kde`.

7.  XDG SESSION TYPE:

        XDG_SESSION_TYPE='x11'

8.  Bash Version:

        BASH_VERSION='5.2.15(1)-release'

# Environment:
1.  DISPLAY:

        DISPLAY=':0'


        WAYLAND_DISPLAY=''

2.  Keyboard Layout:

    1.  `setxkbmap`:

            xkb_keymap {
            	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
            	xkb_types     { include "complete"	};
            	xkb_compat    { include "complete"	};
            	xkb_symbols   { include "pc+us+inet(evdev)"	};
            	xkb_geometry  { include "pc(pc104)"	};
            };

    2.  `xprop`:

            _XKB_RULES_NAMES(STRING) = "evdev", "pc104", "us", "", ""

3.  Locale:

    1.  All locales:

            C
            C.utf8
            en_US.utf8
            POSIX
            zh_CN.utf8

    2.  Current locale:

            LANG=en_US.UTF-8
            LANGUAGE=C
            LC_CTYPE="en_US.UTF-8"
            LC_NUMERIC=C
            LC_TIME=C
            LC_COLLATE="en_US.UTF-8"
            LC_MONETARY=C
            LC_MESSAGES="en_US.UTF-8"
            LC_PAPER="en_US.UTF-8"
            LC_NAME="en_US.UTF-8"
            LC_ADDRESS="en_US.UTF-8"
            LC_TELEPHONE="en_US.UTF-8"
            LC_MEASUREMENT=C
            LC_IDENTIFICATION="en_US.UTF-8"
            LC_ALL=

4.  Directories:

    1.  Home:

            /home/brandon

    2.  `${XDG_CONFIG_HOME}`:

        Environment variable `XDG_CONFIG_HOME` is not set.

        Current value of `XDG_CONFIG_HOME` is `~/.config` (`/home/brandon/.config`).

    3.  Fcitx5 Settings Directory:

        Current fcitx5 settings directory is `~/.config/fcitx5` (`/home/brandon/.config/fcitx5`).

5.  Current user:

    The script is run as brandon (1000).

# Fcitx State:
1.  executable:

    Found fcitx5 at `/usr/bin/fcitx5`.

2.  version:

    Fcitx version: `5.0.21`

3.  process:

    Found 1 fcitx5 process:

           2572 fcitx5

4.  `fcitx5-remote`:

    `fcitx5-remote` works properly.

5.  DBus interface:

    Using `dbus-send` to check dbus.

    Owner of DBus name `org.fcitx.Fcitx5` is `:1.13`.

    PID of DBus name `org.fcitx.Fcitx5` owner is `2572`.

    Debug information from dbus:

           Group [x11::0] has 8 InputContext(s)
          IC [cee46313441c4a4e8928e72e7f8f99a8] program:tilix frontend:dbus cap:6000000012 focus:0
          IC [1ec327554fd64711b1f54355c27da155] program:tilix frontend:dbus cap:6000000012 focus:1
          IC [e9b757b96f3c40e3928c808a81056f94] program:tilix frontend:dbus cap:6000000012 focus:0
          IC [ae8ad9eedba64911bbd44ebdc6c872e1] program:tilix frontend:dbus cap:6000000012 focus:0
          IC [df4cab852c514f47bcba2068dc1186b0] program:google-chrome-stable frontend:dbus cap:6000000012 focus:0
          IC [9025e14ecf294ed58e6fdd750fa69a04] program:kwin_x11 frontend:dbus cap:16000800072 focus:0
          IC [47f8a06b6b0f4b15bcade1e2f0a817f2] program: frontend:dbus cap:0 focus:0
          IC [3e60f007ad864f87bc59ff8f7dd25847] program:plasmashell frontend:dbus cap:16000800072 focus:0
        Input Context without group

# Fcitx Configure UI:
1.  Config Tool Wrapper:

    Found fcitx5-configtool at `/usr/bin/fcitx5-configtool`.

2.  Config GUI for qt:

    Found `fcitx5-config-qt` at `/usr/bin/fcitx5-config-qt`.

3.  Config GUI for kde:

# Frontends setup:
## Xim:
1.  `${XMODIFIERS}`:

    Environment variable XMODIFIERS is set to "@im=fcitx" correctly.
    Xim Server Name from Environment variable is fcitx.

2.  XIM_SERVERS on root window:

    Xim server name is the same with that set in the environment variable.

## Qt:
1.  qt4 - `${QT4_IM_MODULE}`:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

2.  qt5 - `${QT_IM_MODULE}`:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

3.  Qt IM module files:

    Found fcitx5 qt5 module: `/usr/lib/x86_64-linux-gnu/fcitx5/qt5/libfcitx-quickphrase-editor5.so`.
    Found fcitx5 im module for qt5: `/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`.
    Found fcitx5 im module for qt6: `/usr/lib/x86_64-linux-gnu/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`.

    Following error may not be accurate because guessing Qt version from path depends on how your distribution packages Qt. It is not a critical error if you do not use any Qt application with certain version of Qt or you are using text-input support by Qt under Wayland.
    **Cannot find fcitx5 input method module for Qt4.**

## Gtk:
1.  gtk - `${GTK_IM_MODULE}`:

    Environment variable GTK_IM_MODULE is set to "fcitx" correctly.

2.  `gtk-query-immodules`:

    1.  gtk 2:

        **Cannot find `gtk-query-immodules` for gtk 2**

        **Cannot find fcitx5 im module for gtk 2.**

    2.  gtk 3:

        **Cannot find `gtk-query-immodules` for gtk 3**

        **Cannot find fcitx5 im module for gtk 3.**

3.  Gtk IM module cache:

    1.  gtk 2:

        Found immodules cache for gtk `2.24.33` at `/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache`.
        Version Line:

            # Created by /usr/lib/x86_64-linux-gnu/libgtk2.0-0/gtk-query-immodules-2.0 from gtk+-2.24.33

        Found fcitx5 im modules for gtk `2.24.33`.

            "/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-fcitx5.so" 
            "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
            "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 

    2.  gtk 3:

        Found immodules cache for gtk `3.24.38` at `/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache`.
        Version Line:

            # Created by /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 from gtk+-3.24.38

        Found fcitx5 im modules for gtk `3.24.38`.

            "/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-fcitx5.so" 
            "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
            "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 

    3.  gtk 4:

        **Cannot find immodules cache for gtk 4**

        **Cannot find fcitx5 im module for gtk 4 in cache.**

4.  Gtk IM module files:

    1.  gtk 2:

        All found Gtk 2 immodule files exist.

    2.  gtk 3:

        All found Gtk 3 immodule files exist.

    3.  gtk 4:

        All found Gtk 4 immodule files exist.

# Configuration:
## Fcitx Addons:
1.  Addon Config Dir:

    Found fcitx5 addon config directory: `/usr/share/fcitx5/addon`.

2.  Addon List:

    1.  Found 29 enabled addons:

            Chewing 5.0.13
            Simplified and Traditional Chinese Translation 5.0.16
            Classic User Interface 5.0.21
            Clipboard 5.0.21
            Cloud Pinyin 5.0.16
            DBus 5.0.21
            DBus Frontend 5.0.21
            Emoji 5.0.21
            Fcitx4 Frontend 5.0.21
            Full width character 5.0.16
            IBus Frontend 5.0.21
            Lua IME API 5.0.10
            Input method selector 5.0.21
            Keyboard 5.0.21
            KDE Input Method Panel 5.0.21
            Lua Addon Loader 5.0.10
            Status Notifier 5.0.21
            Notification 5.0.21
            Pinyin 5.0.16
            Extra Pinyin functionality 5.0.16
            Punctuation 5.0.16
            Quick Phrase 5.0.21
            Spell 5.0.21
            Table 5.0.16
            Unicode 5.0.21
            Wayland 5.0.21
            Wayland Input method frontend 5.0.21
            XCB 5.0.21
            X Input Method Frontend 5.0.21

    2.  Found 0 disabled addons:

3.  Addon Libraries:

    All libraries for all addons are found.

4.  User Interface:

    Found 2 enabled user interface addons:

        Classic User Interface
        KDE Input Method Panel

## Input Methods:
1.  `/home/brandon/.config/fcitx5/profile`:

        [Groups/0]
        # Group Name
        Name=默认
        # Layout
        Default Layout=us
        # Default Input Method
        DefaultIM=pinyin

        [Groups/0/Items/0]
        # Name
        Name=keyboard-us
        # Layout
        Layout=

        [Groups/0/Items/1]
        # Name
        Name=pinyin
        # Layout
        Layout=

        [GroupOrder]
        0=默认

# Log:
1.  `date`:

        Sat Feb  1 19:16:08 CST 2025

2.  `/home/brandon/.config/fcitx5/crash.log`:

    `/home/brandon/.config/fcitx5/crash.log` not found.

**Warning: the output of fcitx5-diagnose contains sensitive information, including the distribution name, kernel version, name of currently running programs, etc.**

**Though such information can be helpful to developers for diagnostic purpose, please double check and remove as necessary before posting it online publicly.**

你的 locale 怎么有部分是 C?

或许因为我的语言设置的是 C?
不过我感觉不是这个问题, 因为我在其他地方都可以使用输入法。

你的感觉有用的话那还来问什么呢?
经验表明部分 XIM 程序就是会被这个影响。
你的「其他地方」都是走 D-Bus 协议的,那边是没有 XIM 那么多奇奇怪怪的问题。
另外我建议你运行「官网下载的版本」的时候也抓一下调试信息以便对比。

行,那我换下语言试试看,另外怎么看输入法的调试信息?

fcitx5-diagnose 里就有,「Debug information from dbus」这部分。手动调用的话可以这样:dbus-send --print-reply=literal --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.DebugInfo

这里会列出应用程序使用的输入法协议。另外还可以看看应用程序是否接收到了输入法相关的环境变量,可以在 htop 里找到进程后按 e 来查看该进程的环境变量。

我改过了, 但好像还是无法使用

    2.  Current locale:

            LANG=en_US.UTF-8
            LANGUAGE=en_US
            LC_CTYPE="en_US.UTF-8"
            LC_NUMERIC="en_US.UTF-8"
            LC_TIME="en_US.UTF-8"
            LC_COLLATE="en_US.UTF-8"
            LC_MONETARY="en_US.UTF-8"
            LC_MESSAGES="en_US.UTF-8"
            LC_PAPER="en_US.UTF-8"
            LC_NAME="en_US.UTF-8"
            LC_ADDRESS="en_US.UTF-8"
            LC_TELEPHONE="en_US.UTF-8"
            LC_MEASUREMENT="en_US.UTF-8"
            LC_IDENTIFICATION="en_US.UTF-8"
            LC_ALL=

或者要改成其他语言?

试试 zh_CN.UTF-8(记得先启用该 locale)。我记得 Emacs 好像有些时候要指定 CJK 的 locale 才能用输入法。

我检查了两个软件启动时的指令, 都是 <app-path> --path <project-path> -e <scene-path>, 貌似并没有区别
另:

$ dbus-send --print-reply=literal --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.DebugInfo
   Group [x11::0] has 16 InputContext(s)
  IC [1cb718affcbf424992a074b98787823f] program:tilix frontend:dbus cap:6000000012 focus:1
  IC [7fa52d77c1e040e1a1ab82b00d03b438] program:tilix frontend:dbus cap:6000000012 focus:0
  IC [57ecb1fca86348a899f31ef5e48ee22c] program:tilix frontend:dbus cap:6000000012 focus:0
  IC [21737d5800294064b955f9f2212005e2] program:Godot_v4.3-stable_linux.x86_64 frontend:xim cap:4000000000 focus:0 # 注: 这是官网的 Godot
  IC [3fa7c78ebb9b48148335a6bc7967662c] program:dolphin frontend:dbus cap:16000800072 focus:0
  IC [16a32e4a512a42fcad6d426e300c448e] program:godot.x11.opt.tools.64 frontend:xim cap:4000000000 focus:0 # 注: 这是 Steam 的 Godot
  IC [003bb7bc01a147539a472d45428474e0] program:plasmashell frontend:dbus cap:16000800072 focus:0
  IC [0ff287e144a847ca9a3d57ddfabbf113] program:steamwebhelper frontend:dbus cap:0 focus:0
  IC [e7e8a501d9514170aca284cf2c5c2c22] program:steam frontend:dbus cap:0 focus:0
  IC [9907685047544dc4a311f60ce1998f33] program:tilix frontend:dbus cap:6000000012 focus:0
  IC [e74d4f1649b24e409a50ddca112a7476] program:tilix frontend:dbus cap:6000000012 focus:0
  IC [ccb174fb211a44b78eefc3d2cc8e121b] program:tilix frontend:dbus cap:6000000012 focus:0
  IC [9092b47d8b844ba0b33730e968ebf888] program:google-chrome-stable frontend:dbus cap:6000000012 focus:0
  IC [7a069512f9464f2db5d8435316090093] program:tilix frontend:dbus cap:6000000012 focus:0
  IC [1dfab79b823c4088958008bc8ff09330] program:kwin_x11 frontend:dbus cap:16000800072 focus:0
  IC [1bed05b7e14c48868984e2ed1b4cb61c] program:krunner frontend:dbus cap:16000800072 focus:0
Input Context without group

又另: 语言已经改过了:

    2.  当前 locale:

            LANG=zh_CN.UTF-8
            LANGUAGE=zh_CN
            LC_CTYPE="zh_CN.UTF-8"
            LC_NUMERIC="zh_CN.UTF-8"
            LC_TIME="zh_CN.UTF-8"
            LC_COLLATE="zh_CN.UTF-8"
            LC_MONETARY="zh_CN.UTF-8"
            LC_MESSAGES="zh_CN.UTF-8"
            LC_PAPER="zh_CN.UTF-8"
            LC_NAME="zh_CN.UTF-8"
            LC_ADDRESS="zh_CN.UTF-8"
            LC_TELEPHONE="zh_CN.UTF-8"
            LC_MEASUREMENT="zh_CN.UTF-8"
            LC_IDENTIFICATION="zh_CN.UTF-8"
            LC_ALL=

咦,所以你的 godot 已经用上了 XIM。

对应的问题是这个吗?「没法输入中文字符」是指通过输入法提交的英文字符能够输入?

也不行