LibreService / my_rime

Free and Open Source online Chinese IME powered by RIME. 自由开源在线中文输入法 拼音 双拼 粤语 注音 五笔 仓颉 速成

Home Page:https://my-rime.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

打不出字,请问是不是不支持小键盘输入?

xiaobai9978 opened this issue · comments

image
image

image
image

我已经成功添加进去了我的输入法,不过我的输入法是用小键盘打字。请问是我操作的问题还是不支持这种输入方式?
非常感谢

我也试验了好久但没有成功。包括让前端发送KP_[0-9]这样的代码,但好像librime的key simulation没有支持这种表达,把中间的_直接变成破折号——了。还有试了schema文件里用于屏蔽大键盘的那些key_binder也给去掉了,在桌面端可以用大键盘输入,但在这里大键盘也不管用。

会是因为词库没加载成功吗?

会是因为词库没加载成功吗?

如果你使用了ENABLE_LOGGING=ON,那F12的控制台可以看到glog的输出,比如luna_pinyin会有

I20230302 19:28:10.597999 300364 table.cc:299] loading table file: /build/luna_pinyin.table.bin

没什么异常的话加载就没问题。

小键盘不支持肯定是我的问题(因为我是87键用户
我只检查了KeyboardEvent的key,大小键盘的key是一样的,得通过code区分。
好在树莓派78键键盘可以模拟小键盘,我会拿你的输入法测测。

日志里看到了:

E20230303 14:31:25.791999 300972 mapped_file.cc:112] attempt to open non-existent file '/build/xiaobai.table.bin'. [rime.js:formatted:1020](http://localhost:8080/rime.js:formatted)
E20230303 14:31:25.791999 300972 table.cc:305] Error opening table file '/build/xiaobai.table.bin'. [rime.js:formatted:1020](http://localhost:8080/rime.js:formatted)
E20230303 14:31:25.791999 300972 dictionary.cc:326] Error loading table for dictionary 'xiaobai'. [rime.js:formatted:1020](http://localhost:8080/rime.js:formatted)

确实词库加载有问题,但是检查了build/librime_native/bin/build/xiaobai.table.bin,文件是存在的。

文件加载是从public/ime,那里肯定没有。因为我做了个错误假设,即每个schemaId对应的文件都以schemaId开头

for (const fileName of fileNames) {
const id = fileName.split('.')[0]
if (id in schemaFiles) {

只有rime官方输入法是遵照这个假设的,我得把install_schemas.mjs大修一下

6e7cabb 解决了词库加载问题。我用来测试的配置如下

[
  {
    "id": "xiaobai_simp",
    "name": "小白T9输入法",
    "emoji": true,
    "target": "xiaobai9978/rime-xiaobai_simp",
    "variants": [],
    "license": "GPL-3.0-only"
  }
]

你的输入法有两个问题,一个是不兼容plum,要么按照#8 (comment) 手动把dicts复制到build/librime_native/bin,要么按bczhc/rime-xiaobai_simp@cd50479 把目录打平;还有就是繁简转换似乎不起作用,所以我给variants赋值为[]以屏蔽了转换功能。
Screenshot from 2023-03-04 20-54-13

好像librime的key simulation没有支持这种表达

感觉是你缺了花括号。现在往URL加上debug=on参数可以显示下面的输入框,来直接给librime发key sequence(按回车发送)。

资辞了73f109b
本来想加个测试,奈何playwright doesn't support numpad microsoft/playwright#15187

成功了,非常感谢