Detecting if a mouse is wireless

孤者浪人 提交于 2019-12-08 11:33:33

问题


I am trying to detect whether a wireless mouse is present on a computer. I would like my program to run in the background. I would prefer to do this in Java however if this goes beyond Java's capabilities I can use another language.

Can someone please get me started?

(This seems like a Google-able question but I cannot find anything)


回答1:


This is beyond Java and is highly OS-specific. You have to query the appropriate device drivers for the operating system; for example, on Linux this would mean looking up information in the evdev system. Note that the particular "type" of wireless will matter a lot, and you may not be able to tell in any reliable way. For example, a Bluetooth mouse is always wireless, but some wireless devices connect with a USB dongle and may not be distinguishable from a wired USB device.



来源:https://stackoverflow.com/questions/18325977/detecting-if-a-mouse-is-wireless

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!