library is not working with more than 2 keyboards
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
从 example 文件夹中的修改后示例开始,使用 /dev/input/event21 和 /dev/input/event23 重现该行为,然后按照描述添加第三个键盘。在 Ubuntu 或 Raspberry Pi 上跟踪库如何读取并发出每个设备的事件;当所有已连接键盘的按键事件都能立即且独立地记录时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Hi!
Thank you for this great library.
It is exactly what I need for a project where i have to listen to and be able to distinguish between 4 different keyboard inputs.
I tried it on ubuntu 16.04 and on raspberry pi 3.
Everything works fine with 2 keyboards attached, but unfortunately I get some very strange behaviour when I attach a third one.
I use this slightly modified example code inside of the example folder
const InputEvent = require('../')
let inputSlots = [21, 23]
let inputs = []
let readers = []
for (let i = 0; i < inputSlots.length; i++) {
try {
inputs[i] = new InputEvent(`/dev/input/event${inputSlots[i]}`)
readers[i] = new InputEvent.Keyboard(inputs[i])
readers[i].on('keyup', (data) => { console.log(`reader ${i}: ${data.code}`) })
} catch (err) {
console.error(`Can not open device ${i}`)
}
if (readers[i]) {
readers[i].on('error', (data) => { console.log(`reader ${i}: ${data.code}`) })
}
}
When I adapt the inputSlots array and attach a third keyboard, the keycode doesn't get logged to the console immediately when pressing a key.
I have to press a key on one of the other 2 attached keyboards, then the keycode from before and the keycode from the key that was just pressed are logged.
If i now press another key on this keyboard the thing starts again and i have to press a key on one of the other keyboards in order to log the keycode.
I am wondering if you have ever encountered this problem, or if you happen to know what could be the reason for this behaviour.
I also tried it with the 'keydown' and 'keypress' event, but that didnt change anything.
Thank you very much
Best regards
- 主要语言
- JavaScript
- 星标
- 65
- 派生
- 22
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lsongdev/input-event 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 42/100
lsongdev/input-event#22 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
lsongdev/input-event#21 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
lsongdev/input-event#16 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 25/100
lsongdev/input-event#13 · 1 条评论 ·
-
help wanted
难度 5/5 一周以上 新手友好度 25/100
lsongdev/input-event#10 · 1 个 reaction ·
查看 lsongdev/input-event 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复
-
Design only Leadership Survey SLFS
难度 2/5 1-3 小时 新手友好度 70/100
bcgov/digital-journeys#2293 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
tursodatabase/turso#9405 ·
维护者通常 1 天内回复
-
Toolkit
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
API Bug
难度 2/5 1-3 小时 新手友好度 78/100
ProjectSidewalk/SidewalkWebpage#5556 ·
维护者通常 1 天内回复