java - The Python library easyhid doesn't need set udev rules, whereas similar libraries like usb4java for Java need them to work on Linux
问题描述
Recently I made a peculiar observation. I wrote a small python script to communicate with my keyboard using the easyhid library. Finding, opening and also sending data to the device works out of the box. With Java on the other hand, I was able to find the device, but opening the device was not possible (tested with usb4java and hid4java). After a while, I found out that I did forget to set an udev rule for that keyboard. After I added that rule, opening the device was also possible in Java.
Now the question is: Why does easyhid still work if the udev rule is not set? Both the Python and the Java program are started with the same user rights. I also found out, that both libraries use the same backbone (hidapi). Is there a simple explanation for that behavior? It boggles me, as the python script shouldn't have more rights than the java program.
解决方案
推荐阅读
- python - Python Pandas:如何读取列表中的所有元素并从数据框中检索相应的值
- java - Web 应用程序会话与令牌的安全性
- python - 使用 elasticsearch 遍历查询的所有结果
- cmake - 如何在 Yocto 项目配方中设置 cmake 参数 CMAKE_MODULE_PATH?
- java - 有人可以解释下面的代码吗?它是用于Java游戏开发的双缓冲代码
- r - 将函数应用于数据帧 r 的子集
- sql - 如何仅按单列过滤?
- openshift - minishift - 为 openshift 内部 docker 注册表设置身份验证?
- python - 如何根据另一个键引用 DataFrame 单元格
- r - 在 R 中绘制蒙特卡洛模拟