如何阅读/ dev / input / eventX

时间:2022-09-21 19:40:24

I want to read input-data (keyboard-input) from the /dev/input/eventX-Files. I thought, I find the informations in:

我想从/ dev / input / eventX-Files读取输入数据(键盘输入)。我想,我发现了以下信息:

lrwxrwxrwx 1 root root 9 19. Feb 07:45 usb-_USB_Keyboard-event-if01 -> ../event4
lrwxrwxrwx 1 root root 9 19. Feb 07:45 usb-_USB_Keyboard-event-kbd -> ../event3

But when I read the events, they are empty. The date and time of the files (read with ls -l) suggest that they does not have changed since system boot.

但是当我读到这些事件时,它们是空的。文件的日期和时间(使用ls -l读取)表明它们自系统引导后没有更改。

Can somebody tell me how to get such informations like keyboard-input.

有人可以告诉我如何获得像键盘输入这样的信息。

Gruß, Andre

Solution: When I was logged in as root today it worked, I could read the input from the keyboard.

解决方案:当我今天以root身份登录时,它可以工作,我可以从键盘读取输入。

1 个解决方案

#1


0  

Solution: When I was logged in as root today it worked, I could read the /dev/input/event*-device.

解决方案:当我今天以root用户身份登录时,我可以读取/ dev / input / event * -device。

So it was a permission-issue.

所以这是一个许可问题。

#1


0  

Solution: When I was logged in as root today it worked, I could read the /dev/input/event*-device.

解决方案:当我今天以root用户身份登录时,我可以读取/ dev / input / event * -device。

So it was a permission-issue.

所以这是一个许可问题。