busyo
(朽朽朽朽朽)
July 18, 2025, 6:22pm
1
该方案仅在 KDE6 和 Hyprland 下测试过,不保证没有其他问题发生
目前漏字主要是在 steam 发生,Caps_Lock 在 KDE 下偶发, Hyprland 必现
演示:
漏字修复
大写锁定修复(Hyprland环境)
原理是修改 librime 引擎对输入的处理逻辑
修改了 engine.cc 中 ProcessKey 函数处理完 ProcessKeyEvent 之后还存在的无法处理的内容的补充处理,主要是拦住中文输入时 a-z A-Z 的上屏
修改了 ascii_composer.cc 中 ProcessCapsLock 函数调用 SwitchAsciiMode 方法切换 ascii 输入状态(英文输入)的传参,从 librime 维护的 caps 掩码状态改为新增的专门定义用于记录大小写锁定状态的 caps_lock_pressed_ 变量
补丁文件:
https://github.com/busyoGG/librime-patch/blob/main/fix_input.patch
完整步骤:
# 首次执行 克隆 librime 仓库
git clone https://github.com/rime/librime.git
cd librime
# 切换到特定提交(patch基于该提交制作
git checkout 1a1fbbe
# 首次执行 引入插件
cd plugins
git clone https://github.com/hchunhui/librime-lua
git clone https://github.com/lotem/librime-proto
git clone https://github.com/rime/librime-predict
git clone https://github.com/lotem/librime-octagram
cd ..
# 首次不执行(按需执行) 用于重置代码
git reset --hard 1a1fbbe
# 应用补丁
git apply path/to/fix_input.patch
# 编译安装
rm -rf ./build && make -j$(nproc) && sudo make install
已知的问题
如果在大写锁定的情况下才启用输入法会造成无法输入中文,不过一般不会这样操作吧(
正式的修复还是等原作者更新,这只是个临时方案(
busyo
(朽朽朽朽朽)
July 19, 2025, 11:30am
3
提了 PR,不过作为临时解决方案,这个 patch 对源代码的修改比较粗暴(
busyo
(朽朽朽朽朽)
August 24, 2025, 12:43pm
4
sb了,librime git 仓库已经修复了大小写的问题,arch 仓库的版本太旧了,先入为主以为 librime 没修复这个问题,这个 patch 反而破坏了功能
busyo
(朽朽朽朽朽)
August 24, 2025, 2:25pm
5
编辑不了原帖了,在这里改一下
修改了 editor.cc 的 ProcessKeyEvent 判断条件,之前的修改都不需要了
补丁文件:
From 0c94db4f99814164140ae839c86c9eec60d6d12f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=BD=E6=9C=BD=E6=9C=BD=E6=9C=BD=E6=9C=BD?=
<694253220@qq.com>
Date: Sun, 24 Aug 2025 22:19:39 +0800
Subject: [PATCH] fix missing character bug
---
src/rime/gear/editor.cc | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/rime/gear/editor.cc b/src/rime/gear/editor.cc
index 37b3dda6..511a2fe3 100644
--- a/src/rime/gear/editor.cc
+++ b/src/rime/gear/editor.cc
@@ -44,10 +44,17 @@ Editor::Editor(const Ticket& ticket, bool auto_commit)
}
ProcessResult Editor::ProcessKeyEvent(const KeyEvent& key_event) {
- if (key_event.release())
- return kRejected;
此文件已被截断。 显示原始文件
# 首次执行 克隆 librime 仓库
git clone https://github.com/rime/librime.git
cd librime
# 切换到特定提交(patch基于该提交制作
git checkout 0ecfc9c
# 首次执行 引入插件
cd plugins
git clone https://github.com/hchunhui/librime-lua
git clone https://github.com/lotem/librime-proto
git clone https://github.com/rime/librime-predict
git clone https://github.com/lotem/librime-octagram
cd ..
# 首次不执行(按需执行) 用于重置代码
git reset --hard 0ecfc9c
# 应用补丁
git apply path/to/fix_input.patch
# 编译安装
make -j$(nproc) && sudo make install
不知道有没有其他 bug,目前还没遇到(
librime 已经更新到 extra-testing 了,但是卡在里面很久了。大概是因为没有 arch testing team 的人去测试?
busyo
(朽朽朽朽朽)
September 18, 2025, 4:16am
7
发现 CapsLock 还是有问题,原因是 Fcitx5 的 waylandimserverv2 没有发送 lock 掩码
同时修复了 Electron Wayland 下无法删除第一个预编辑字母的 bug
这两个问题都是在非 KDE 下发现的(niri 测试),KDE 走的是 V1 协议
补丁文件:
fix_waylandimserverv2_bug.patch
git clone https://github.com/fcitx/fcitx5.git
cd fcitx5
git apply path/to/fix_waylandimserverv2_bug.patch
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j$(nproc)
sudo make install