apmorton / pyhidapi

hidapi bindings in ctypes
MIT License
112 stars 42 forks source link

What are the functions to read the incoming data from a keyboard #42

Closed itzB2 closed 4 years ago

itzB2 commented 4 years ago

I tried using the read function But this happened

from hid import * vid = My VID pid = My PID try: h = Device(vid, pid) product_type=str(h.product) is_usb=str(h.manufacturer) if (product_type == "USB Keykoard" and is_usb == "USB"): print("Found Your Keyboard...") except HIDException: print("Connect your device") h.read(size = 64)

It throws me this error hid.HIDException: Access is denied. Please help me

apmorton commented 4 years ago

A normal hid keyboard will get a keyboard class driver loaded by your operating system that takes full control. If you want to read the keyboard input reports in userspace you need to prevent the keyboard driver from loading on the vid/pid of the keyboard in question.

itzB2 commented 4 years ago

How would i do that

itzB2 commented 4 years ago

tell me

apmorton commented 4 years ago

This is not your personal support forum, your question does not directly relate to the library of subject here, and nobody owes you answers - especially if you are being impatient/rude.