hid

Native way to get the feature report descriptor of HID device?

老子叫甜甜 提交于 2019-12-06 06:14:11
We have some HID devices (touch digitizers) that communicate with an internal R&D tool. This tool parses the raw feature reports from the devices to draw the touch reports along with some additional data that are present in the raw feature report but filtered out by the HID driver of Windows 7 (eg, pressure data is not present in WM_TOUCH messages). However, we have started working with some devices that may have different firmware variants, and thus that do not share the same ordering or bytelength of the fields and I need to modify our R&D tool so that it will adapt transparently to all the

MacOS Virtual Input Devices

风格不统一 提交于 2019-12-06 05:13:32
How can I create a virtual HID device in code? I'm trying to avoid writing a kernel extension to accomplish this, but it seems to be the only way. I need to be able to create virtual HID devices of all types, and have an app running in the background feed them events. Is there a way to do this in user-space, or must I venture into kernel land? The typical way of creating HID devices is to use the IOHID* classes in IOKit. You can write a userclient that passes events in and out. I'm not sure what a "virtual" HID device is, however, I guess. If you want to create a keyboard on the screen, that

INF file for HID device - setting name and icon

家住魔仙堡 提交于 2019-12-06 02:55:06
问题 I'm looking to create an inf file for a HID device (which has a custom VID/PID). I just want to replace the strings "HID-compliant device" and "USB Input Device" for our device with our strings. I know this will need signing by Microsoft, but is there a good example of how to do this? 回答1: Example of custom HID INF file on MSDN may help you 来源: https://stackoverflow.com/questions/19401162/inf-file-for-hid-device-setting-name-and-icon

“ The crash happened outside the Java Virtual Machine in native code.”how to solve this error (Java)?

时光总嘲笑我的痴心妄想 提交于 2019-12-06 02:29:26
Using the library in this link http://www.blog.kslemb.com/doku.php/en/projects/globx/java_hid I have been modfied this code to write on a HID terminal if (HIDHandle.equals(WinBase.INVALID_HANDLE_VALUE)) { return HID_DEVICE_NOT_OPENED; } /* Write Feature report */ boolean Status=Kernel32.INSTANCE.WriteFile(HIDHandle, buffer, (int)buffersize, null, null); if (Status == false) { debug("Write File: " + getSystemError(Kernel32.INSTANCE.GetLastError())); return HID_DEVICE_TRANSFER_FAILED; } else { return HID_DEVICE_SUCCESS; } This code would successfully writes on the HID device but then it would

USB relay commands

╄→尐↘猪︶ㄣ 提交于 2019-12-05 23:15:09
I have this USB Relay: http://www.ebay.com/itm/5V-USB-Relay-2-Channel-Programmable-Computer-Control-For-Smart-Home-/141097843081?pt=LH_DefaultDomain_0&hash=item20da163989 Al I need is to send close/open to the device (to turn on & off an LED light) How can I do that using C# or C++? Thanks Boaz Here's what you need (tested on Linux) : HIDAPI from http://www.signal11.us/oss/hidapi/ USBRELAY from https://github.com/darrylb123/usbrelay/blob/master/README.md Use it like : usbrelay ZG4HU_1=1 usbrelay ZG4HU_1=0 to switch the first relay on and off. ZG4HU_2 addresses the second relay and without

How to get list of HID devices in a Swift/Cocoa application?

不羁岁月 提交于 2019-12-05 20:01:36
The following code works perfectly to get a list of connected HID devices: import Foundation import IOKit import IOKit.usb import IOKit.hid private func createDeviceMatchingDictionary( usagePage: Int, usage: Int) -> CFMutableDictionary { let dict = [ kIOHIDDeviceUsageKey: usage, kIOHIDDeviceUsagePageKey: usagePage ] as NSDictionary return dict.mutableCopy() as! NSMutableDictionary; } let manager = IOHIDManagerCreate(kCFAllocatorDefault, IOOptionBits(kIOHIDOptionsTypeNone)); let keyboard = createDeviceMatchingDictionary(usagePage: kHIDPage_GenericDesktop, usage: kHIDUsage_GD_Keyboard)

iOS USB HID programming

邮差的信 提交于 2019-12-05 19:15:42
I am trying to make some code regarding USB HID devices. I have found an article about Bluetooth programming which uses Game Kit Framework . Now I'm looking for some tutorial or maybe some code to work on connecting HID device via USB. Where should I look? Is Game Kit the right way? Is it difficult to implement communication between iOS and HID device? You can use IOKit for USB, but it's a private framework on iOS - so it depends if you want to deploy to the App Store. Here is the USB Intro for Mac , I'm not sure if it's the same on iOS - but just to get the idea. Actually I just found out

python reading HID

孤街醉人 提交于 2019-12-05 18:24:37
I'd like to do a program that takes input from HIDs attached to a linux system and generates MIDI from those. I'm ok on the MIDI side, but I'm struggling on the HID side of things. While this approach works ok (taken from here ): #!/usr/bin/python2 import struct inputDevice = "/dev/input/event0" #keyboard on my system inputEventFormat = 'iihhi' inputEventSize = 16 file = open(inputDevice, "rb") # standard binary file input event = file.read(inputEventSize) while event: (time1, time2, type, code, value) = struct.unpack(inputEventFormat, event) print type,code,value event = file.read

Windows virtual mouse driver

旧街凉风 提交于 2019-12-05 17:19:58
I am developing a KMDF virtual mouse driver. The general idea is a KMDF root enumerated non-filter driver which will be able to send output reports to the mouse and keyboard driver stacks. My driver is already working and sending requests to other driver stacks, but with no result. Report types and packet formats are pretty undocumented on Microsoft resources. There are no information about which data and to which device I need to send in order to move the mouse pointer, simulate clicks (with either mouse or keyboard). There is only general information about HID clients, drivers etc. Their

Prevent usbhid from autoloading when USB HID device is plugged in

我的未来我决定 提交于 2019-12-05 16:01:33
I'm trying to (reversibly) disable USB HID support on a Raspbian Jessie install, kernel version 4.4.16-v7+. We need to have the Raspberry Pi in a semi-public space and display stuff on a TV, and we'd like to make it at least somewhat hard to mess with it. So far I've managed to make the usbhid module removable from the kernel via rmmod. After rmmod'ing the module, tt seems, though, that each time I plug in a USB keyboard or mouse, the device driver gets loaded back into the Kernel. Is there any way to prevent that? udev is the best and easiest way doing that, add a new rule in e.g.: /etc/udev