Author Topic: xinput WTF is it?  (Read 12977 times)

ulao

  • Frequent Contributor
  • ****
  • Posts: 172
xinput WTF is it?
« on: December 01, 2017, 10:08:46 am »
Could anyone here please talk to me at a firmware level? This so called xinput, what is it really? From what I gather xinput is an API that supports xbox controllers. So when someone says "can you support xinput in your device" my answer has to be no... My device being a HID gamepad.

Though in reading I find this xbox controller is nothing more then a limited USB device that communicate with raw hid. So what is raw hid, is that feature reports?

So more specific to my point and if any of that is true, can't I just answer the raw report from my HID device and act as a xbox controller? This then would suggest there is a document (or hidden, proprietary) protocol to follow.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: xinput WTF is it?
« Reply #1 on: December 03, 2017, 12:29:17 pm »
At the firmware level, HIDs send and receive HID reports using interrupt and control transfers.

On the host, a particular API might require supporting a specific report or report type.

ulao

  • Frequent Contributor
  • ****
  • Posts: 172
Re: xinput WTF is it?
« Reply #2 on: December 06, 2017, 12:25:12 pm »
So you think it may be as simple as building a report to match the transfers needed to be xinput?

looks like someone want to do it.
https://forum.pjrc.com/threads/28536-Creating-XUSB-gamepad-device-for-XInput

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: xinput WTF is it?
« Reply #3 on: December 06, 2017, 09:42:58 pm »
Yes, it's just a HID.

ulao

  • Frequent Contributor
  • ****
  • Posts: 172
Re: xinput WTF is it?
« Reply #4 on: February 08, 2018, 09:01:50 am »
Could one write a xinput device without a driver? That is to say so that windows installs a driver for it.  I'm wondering if just changing the device and descriptor reports are enough to get it to show as a xinput.
« Last Edit: February 08, 2018, 09:08:11 am by ulao »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research

ulao

  • Frequent Contributor
  • ****
  • Posts: 172
Re: xinput WTF is it?
« Reply #6 on: February 08, 2018, 03:01:13 pm »

I did like this stament.
Quote
The XUSB driver implements both an XUSB class interface and a HID class interface for devices in order to support both XINPUT and DirectInput usage.

It sounds like xusb is a dll, that support hid and xinput. but my issue is that I want my device to work or emulate a xinput because software developers are expecting xinput. More of them need to support xusb but I can not change what exists.