mi-360
mi-360 copied to clipboard
Please add 3-axis accelerometer support
Thank you for your program so that we can use the Xiaomi Bluetooth controller on the PC smoothly. But in some scenarios, such as in cemu, I hope to use the 3-axis accelerometer of the millet handle to achieve more control. For example, users of the PS4 controller can use ds4windows( https://github.com/rajkosto/DS4Windows ) to simulate the xbox controller and add accelerometer support, which can be used in cemu to aim at the arrow. So I hope that you can add 3-axis accelerometer support so that all the functions of the Xiaomi Bluetooth controller are available on the PC. Thanks again.
Hi!
Yes, I thought about it many times (and I know how to read the sensors data already). The problem is that Xbox 360 does not support any motion axis, so there's no exact correspondence to anything and the accelerometer may be mapped to anything. That would require a configuration UI to let the user choose the mapping, but that would require some major rework, as this tool was never intended to have complex configurations and remapping capabilities.
Until I don't have a clear idea on how to do it in a usable way, I'll keep this feature on hold.
If you have any suggestion, you are welcome to share it here!
I think it can be merged with BetterJoy. BetterJoy maps the accelerometer to a mouse and the keys to x360. https://github.com/Davidobot/BetterJoy
Hi, Daniele!
and I know how to read the sensors data already
Do you have any working Windows code for reading accelerometer data? I've examined https://github.com/irungentoo/Xiaomi_gamepad/blob/master/accelerometer_print/hidraw.c but I can't reproduce it on Windows. Accelerometer values are always zero.
Hi, Daniele!
and I know how to read the sensors data already
Do you have any working Windows code for reading accelerometer data? I've examined https://github.com/irungentoo/Xiaomi_gamepad/blob/master/accelerometer_print/hidraw.c but I can't reproduce it on Windows. Accelerometer values are always zero.
https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn613925(v=vs.85) https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/Accelerometer
@zhangbo8418 Thanks, but it's slightly not what I'm looking for. This is generic code for Windows UWP application. But I'm looking for specific low-level code for extracting accelerometer data from Xiaomi Gamepad.
Hi, Daniele!
and I know how to read the sensors data already
Do you have any working Windows code for reading accelerometer data? I've examined https://github.com/irungentoo/Xiaomi_gamepad/blob/master/accelerometer_print/hidraw.c but I can't reproduce it on Windows. Accelerometer values are always zero.
Hi! I actually tried to enable accelerometer reports without success. I suspect that the feature doesn't even get turned on at all, as I continue receiving reports only when I press something on the gamepad.
@dancol90 do you have any idea why the same packet to enable accel works on Linux but not on window? Maybe the gamepad tried to guest the os and if it is Linux, accel can be enabled, and if its window, accel cannot be enabled. Or maybe hid.dll filter out that packet and actually does not send that packet to the gamepad, for some reason.
I think standard Windows HID driver doesn't pass that packet through, because Xiaomi Gamepad doesn't advertise it in REPORTDESCRIPTOR structure.
I think standard Windows HID driver doesn't pass that packet through, because Xiaomi Gamepad doesn't advertise it in REPORTDESCRIPTOR structure.
So, gyro can't be started under windows?
So, gyro can't be started under windows?
Unless someone writes a kernel-mode native Windows HID driver for Xiaomi Gamepad. I've put my efforts to start writing it, but I don't have experience in writing kernel-mode drivers. So, I've stopped my work on it for now.