简体   繁体   English

如何监控Windows中USB端口的输入?

[英]How can I monitor input on a USB port in Windows?

Short version: How do I monitor a USB port's input? 简短版本:如何监控USB端口的输入?

Long version: I wanted to use a console controller for my pc games, but couldn't find a freeware method of doing so that I liked. 长版本:我想在我的电脑游戏中使用控制台控制器,但找不到我喜欢的免费软件方法。 So I decided to make one myself, as much as a learning exercise as anything else, but I'm not sure how to monitor input on a USB port. 所以我决定自己制作一个,就像学习其他任何东西一样,但我不确定如何监控USB端口的输入。 I assume that if I can monitor one, it won't be hard to experimentally determine what each input is (A button = 00011 etc) on the keyboard, mouse and controller and then just convince the computer that the controller is a keyboard/mouse by switching whatever is inputted by it to what would have been inputted by one of the other devices. 我假设如果我可以监控一个,那么通过键盘,鼠标和控制器实验确定每个输入是什么(A按钮= 00011等)然后只是说服计算机控制器是键盘/鼠标就不难了通过将由其输入的任何内容切换到由其他设备之一输入的内容。

I tried Google, but no luck. 我试过谷歌,但没有运气。 Same with this site. 与此网站相同。 I know some C, C++ and Python but I wouldn't call myself a power user of any of them, part of the reason I'm doing this really. 我知道一些C,C ++和Python,但我不会称自己是任何一个的高级用户,部分原因是我真的这么做。 Currently using Windows Vista and Windows 10. Any help getting started would be appreciated. 目前使用Windows Vista和Windows 10.任何帮助入门将不胜感激。

Try pyusb and you will find examples on how to communicate with USB devices. 尝试使用pyusb ,您将找到有关如何与USB设备通信的示例。 It seems that the current repository is at GitHub: https://github.com/walac/pyusb 似乎当前的存储库位于GitHub: https//github.com/walac/pyusb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM