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

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

Closed
xiaobai9978 opened this issue Mar 2, 2023 · 8 comments
Closed

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

xiaobai9978 opened this issue Mar 2, 2023 · 8 comments

Comments

@xiaobai9978
Copy link

xiaobai9978 commented Mar 2, 2023

image
image

image
image

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

@xiaobai9978 xiaobai9978 changed the title 打不出字,是不是不支持小键盘输入 打不出字,请问是不是不支持小键盘输入? Mar 2, 2023
@bczhc
Copy link
Contributor

bczhc commented Mar 2, 2023

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

@xiaobai9978
Copy link
Author

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

@eagleoflqj
Copy link
Member

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

如果你使用了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键键盘可以模拟小键盘,我会拿你的输入法测测。

@bczhc
Copy link
Contributor

bczhc commented Mar 3, 2023

日志里看到了:

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,文件是存在的。

@eagleoflqj
Copy link
Member

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

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

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

@eagleoflqj
Copy link
Member

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(按回车发送)。

@eagleoflqj
Copy link
Member

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

@xiaobai9978
Copy link
Author

成功了,非常感谢

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

3 participants