signal11 / hidapi

A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac, and Windows.
http://www.signal11.us/oss/hidapi/
Other
2.47k stars 901 forks source link

failed to open the device #454

Closed alireza11048 closed 4 years ago

alireza11048 commented 4 years ago

Hi,

I am trying to communicate with an HID device with this library, I have two problems:

  1. to open the device for write&read I need to run the app with admin permission, is this normal?
  2. some times the library returns an error when I try to open the device, particularly it fails during calling CreateFileA function. and getlasterror() returns permision_denied in this situation. there is any known issue with this? and also the device path of my device is "\\?\hid#vid_1915&pid_520c&mi_01#8&20c16deb&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd" and also it appears as keyboard in system too.
Youw commented 4 years ago

Please see #373

Youw commented 4 years ago

Additionally: Windows driver subsystem owns all mouses and keyboards, so you cannot open those for read/write from user-space. That is a known limitation - security enforcement.

If you need to communicate with mouse/keyboard, you better use native OS hooks for that matter, specifically designed to get mouse/keyboard related events.

This is one of the items we should add as part of #61

alireza11048 commented 4 years ago

Thank you, the problem has solved.