Closed valpackett closed 4 years ago
Thanks for hgame driver.
Could you rework it without using callbacks? Although currently callbacks look better, there are plans to implement HID usage ranges and scatter-gather maps for such a drivers
USB_IFACE_SUBCLASS(UISUBCLASS_XBOX360_CONTROLLER)
knowledge from usbhid
insteadMerged, thanx
that required a new callback though hence somewhat ugly callback
Callbacks were added for things like this one, They should be used if translation can not be written in declarative way.
currently matching by vendor (Microsoft), would be nice to somehow use the USB_IFACE_SUBCLASS(UISUBCLASS_XBOX360_CONTROLLER) knowledge from usbhid instead
May be create hgame.h with required constants?
May be create hgame.h with required constants?
I mean how would I pass the info between drivers.. I guess via hid_device_info
, which is passed as ivars
Yes, hid_device_info is intended to pass information between layers. Do you want place quirks here too?
Yeah, I guess. (I specifically need to pass a USB-level match to a HID driver)
Other way is a global function that compares hid_device_info
structure with the predefined quirk list. That is what USB's usb_test_quirk (and usb_quirk(4)) do. But I never dug in to it so I do not know if it can replace passing quirks between drivers.
Tested on an off-brand cheap USB gamepad with <16 buttons :D but I'm relatively confident in the lots-of-buttons (
BTN_TRIGGER_HAPPY
) support code.The list of individual buttons in
struct hmap_item[]
sucks, would be nice to have a.usage_mask
instead of.usage
that would allow me to match allHUP_BUTTON
s…