hid

Custom HID device HID report descriptor

元气小坏坏 提交于 2019-12-02 19:33:22
I have a bit of a problem with generating HID descriptor. I want to use simple reports with ID1 for input and ID2 for output with 64 bytes of data. I realized that despite rtfming and googling I still do not have a clue about some fields in HID descriptor. Can somebody please give me a hint or a manual where I can find the meaning of all descriptor fields? All I could find was examples for HID-mouse/joistick/keyboard. For example - REPORT_SIZE - is it size in bytes or in bits? And why there also is REPORT_COUNT? If I have 64 bytes in the report, LOGICAL_MAXIMUM must be 255 or 255*64? Should I

How to capture raw HID input on linux?

佐手、 提交于 2019-12-02 14:18:25
Short version of what I want to accomplish : I have a foot pedal (INFINITY-IN-USB-1, if that's of any interest) that is implemented as a generic HID device, and I would like it to be behave as control and alt keys on linux. I'm looking for something on the level on X, i.e. not just individual programs. Longer version : I have this setup working in Windows XP by calling dll RegisterRawInputDevices and GetRawInputData and listening to the input in a hidden windows. All is accomplished with a fairly straightforward Autohotkey script (can post here if anyone is interested). The point is, there is

Problems linking with MinGW (v.4.3.0) and libhid

非 Y 不嫁゛ 提交于 2019-12-02 11:10:09
Context: I'm using Qt 5.9.3 on Windows, building for MinGW 32-bit. The Qt part is a side issue though - the problem seems to be with MinGW. The version of MinGW is 4.3.0, supplied prebuilt as part of the Qt installation. I'm building a library which talks to a USB device over HID. Everything compiles fine, but it fails at the link stage with ./..\..\object\debug\usb_hid_device.o: In function `ZN8MyApp3USB5Win3213getDevicePathB5cxx11Ell': <MYPATH>/../../source/win32/usb_hid_device.cpp:99: undefined reference to `HidD_GetAttributes(void*, _HIDD_ATTRIBUTES*)@8' ./..\..\object\debug\usb_hid_device

chrome.hid.send fails on second use

為{幸葍}努か 提交于 2019-12-02 09:25:29
问题 Something about my use of chrome.hid.send seems to be leaving the bus in a bad state. I consistently can NOT get my second usage of the API call to work. Sometimes, it will also fail on the first usage. WITH THE EXACT SAME CODE, I can come back and try a while later (maybe 10min) and the first send will work. The device I'm working with does not return a response to all messages sent to it. The test message for example, is just a dummy message that is ignored by the device. I've tested this

How to use HidD_GetHidGuid() in c++?

一曲冷凌霜 提交于 2019-12-02 06:40:33
问题 I've posted a similar topic/question, but this time it's a bit different. I'm just trying to use the HidD_GetHidGuid() function to get the window's guid for some hid devices, but it's giving me a error LNK2019: unresolved external symbol _HidD_GetHidGuid@4 referenced in function _main Heres my code: //mainframe.cpp #include<iostream> #include<Windows.h> extern "C" { #include<hidsdi.h> #include<SetupAPI.h> } int main() { int iQuit; LPGUID guid; HidD_GetHidGuid(guid); std::cout << "testing

chrome.hid.send fails on second use

浪尽此生 提交于 2019-12-02 04:22:02
Something about my use of chrome.hid.send seems to be leaving the bus in a bad state. I consistently can NOT get my second usage of the API call to work. Sometimes, it will also fail on the first usage. WITH THE EXACT SAME CODE, I can come back and try a while later (maybe 10min) and the first send will work. The device I'm working with does not return a response to all messages sent to it. The test message for example, is just a dummy message that is ignored by the device. I've tested this both on a mac and a PC. My call stack depth is 2 at this point in my application (literally first one is

HID compliant device will not enumerate using chrome.hid API on ChromeOS

最后都变了- 提交于 2019-12-02 04:12:22
问题 Using a USB HID sensor I can only seem to enumerate the device with the chrome.usb API on ChromeOS. On OS X I can enumerate with the chrome.hid API with no problem. What could be the reasons for HID devices not being identified as such on ChromeOS? 回答1: It is possible the device is blacklisted by the Linux HID driver. If you can put your Chrome OS device in developer mode or connect the device to a Linux computer you can check the kernel log to see how the device is recognized. If all is well

Cannot communicate successfully with USB HID device using writefile()

时光怂恿深爱的人放手 提交于 2019-12-02 03:37:44
I am fairly new to C# as well as windows programming and I am attempting to establish communication between a USB HID device and an app written in c# on a windows xp pc. I have obtained the device path successfully and have used this to establish a valid Handle on the device: IntPtr drive = CreateFile(devicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, IntPtr.Zero); This proved to be a valid handle that yields a positive integer when tested. After creating the handle I call 'HidD_GetPreparsedData' and 'HidP

Python evdev equivalent for OSX

这一生的挚爱 提交于 2019-12-01 17:54:06
I have written a python script that polls evdev for a HID barcode scanner (emulates a keyboard): the script works well on Linux platforms (Ubuntu). Is there an OS X Python equivalent for evdev that would allow minor porting of the existing python script? If you have Python experience and have configured it for a HID device input, please indicate this in your response. I got a simple test working using cython-hidapi (installable as pip install hidapi - note this is different to the one linked in the comments but seems to be similar in function). I also had installed hidapi-devel from macports

Capture and interpret XI2 RawKeyPress event with python

Deadly 提交于 2019-12-01 10:13:04
问题 Self resolved It's posted below as an answer. Trying to get what xinput test-xi2 --root prints with python xlib. Using version 1.9 from github: https://github.com/python-xlib/python-xlib event._data["data"] contents for aaaaoo: a<class 'Xlib.ext.ge.GenericEvent'>(data = b'\t\x00\xa9!v\x17&\x00\x00\x00\t\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', sequence_number = 15, length = 2, evtype = 13, extension = 131, type = 35) <class 'Xlib.ext.ge.GenericEvent'>(data