hid

Getting mouse events from HIDManager in OSX with C++

江枫思渺然 提交于 2019-12-21 12:11:06
问题 I'm porting a game from pc to osx and I'm getting stuck with input events. The main game window is a cocoa app that interfaces with a C++ backend. The pc code uses DirectInput and windows messages to generate keyboard and mouse events that the game understands. When I first started the port I replaced the windows messages with Carbon event handling, but since discovered that Cocoa apps don't fire off carbon events. I did a bit more reading and discovered the HIDManager which seemed to do what

Getting mouse events from HIDManager in OSX with C++

强颜欢笑 提交于 2019-12-21 12:10:06
问题 I'm porting a game from pc to osx and I'm getting stuck with input events. The main game window is a cocoa app that interfaces with a C++ backend. The pc code uses DirectInput and windows messages to generate keyboard and mouse events that the game understands. When I first started the port I replaced the windows messages with Carbon event handling, but since discovered that Cocoa apps don't fire off carbon events. I did a bit more reading and discovered the HIDManager which seemed to do what

Would it be possible to read out physical keyboard strokes in node.js?

放肆的年华 提交于 2019-12-21 05:13:16
问题 I have a node application which runs on a raspberry pi that keeps track of a bunch of UPnP-players (Sonos), which I would like to be able to control through a physical remote. I have a couple of airmouses, which has small keyboards as well as volume buttons that I would like to use. I have tried to get a grip on how to read out physical key strokes on a linux machine, and come to the conclusion that I need to read events from the input device, which in my case would be: /dev/input/by-id/usb

How to translate X11 keycode back to scancode or hid usage id reliably

筅森魡賤 提交于 2019-12-21 04:55:19
问题 Almost self resolved. Background info linux keycode The below is from: linux_xmodmap_tutorial Scancode → a number your keyboard sends to a computer. For USB keyboards, it's defined by the USB standard. Keycode → a number used by Linux kernel to represent key (or mouse button/wheel). The Linux kernel translates scancode to keycode. Keysym → a name for a key. keysym is received by X11 applications. I could be wrong but what sudo evtest prints seems like scancode set 1 and since /dev/input/event

Write data to USB HID using Javascript, HTML5, or any cross platform language (supports Android)

て烟熏妆下的殇ゞ 提交于 2019-12-20 10:35:21
问题 I've written an UI in HTML5 and JavaScript. I chose this implementation so that I could share the same code between both Android Chrome and Windows 8 RT. Now, my next objective is to write data to a USB HID. The device that I'm communicating with is treated as an HID. I'm mentioning this part in case there's a way to write to an HID device rather than a USB RAW device. I've done a lot of research on the matter. But, the HTML5 specs are changing so often that maybe I missed something. Anyways,

Python evdev equivalent for OSX

邮差的信 提交于 2019-12-19 17:43:09
问题 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. 回答1: I got a simple test working using cython-hidapi (installable as pip install hidapi - note this is different to the one

.NET API for HID (USB)? [closed]

爱⌒轻易说出口 提交于 2019-12-17 22:32:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Is there an API in .NET (C#) for using USB HID (Human Interface) devices? 回答1: HidLibrary wraps up all the P/Invoke calls for you. But no it doesn't look there is any nice framework APIs for dealing with USB devices. 回答2: Here's mine little lib for dealing with HIDs. Might be useful especially when you are trying

How do I read input from a USB HID device?

梦想的初衷 提交于 2019-12-17 12:40:06
问题 I'm making an application to run in the background on a salespoint to read input from a usb scanner. How can I get the input of the scanner from C#? And can I differentiate between the scanner and a usb keyboard? (Scanner is a HID device) 回答1: I did this successfully before using a “Raw Input” implementation on CodeProject: Raw Input It allows you to receive both the input (what “keys” are pressed if it mimics a “keyboard”) as well distinguish which device it came from. 来源: https:/

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

本秂侑毒 提交于 2019-12-14 00:33:14
问题 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 =

Powershell: AsyncCallback Events using Hidlibrary

女生的网名这么多〃 提交于 2019-12-13 05:00:08
问题 I need some help implementing asynchronous events in Powershell. As a testbed for a larger HID project I want to use Powershell to read the data from a usb panic button that I got off amazon. The perfect solution would implement the data callback as an event that could then be registered using Register-ObjectEvent. My current approach is to use the Hidlibrary library. I am having difficulty invoking both the Read() or ReadReport() methods. They do not appear to be typical asynccallbacks and