yannbouteiller / vgamepad

Virtual XBox360 and DualShock4 gamepads in python
MIT License
162 stars 21 forks source link

XBOX additional axis #26

Closed marshmellow8 closed 5 months ago

marshmellow8 commented 5 months ago

Hello! Not really an issue, I didn't know how to contact you in other ways.

I'm wondering if there's a way to add Axis that doesn't exist in the original controllers. Let's say I press what would be button A, and it parses to gamepad.new_joystick(value=256) (for example), and that "new" joystick is axis 5. Xbox only use Axis 0 to 4 (counting the triggers).

One example closer to my case would be: if st["b1"] == 1 gamepad.new_joystick(value=256) if st["b1"] == 0 gamepad.new_joystick(value=0)

And I'd expect to see it show 0.255 in Axis 5. Or maybe de DPAD_ buttons be the new axis (UP and DOWN as axis 5 and LEFT and RIGHT as axis 6)

Is that possible with the code as it is? Or would be a suggestion?

yannbouteiller commented 5 months ago

Hi,

This is not possible and not planned in vgamepad, sorry, we are instead concerned with emulating the real controllers as closely as possible, in accordance with Nefarius' framework.

That being said, if you are using Linux, it might be possible to do this with uinput / evdev.

marshmellow8 commented 5 months ago

Thanks!