-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to change pedal axis behavior #110
base: master
Are you sure you want to change the base?
Add option to change pedal axis behavior #110
Conversation
This change allows users to change how their pedal axes behave. Such as inverting the axes, making them start out centered etc.
One last thing: There is also a visual bug when you combine pedals, where sometimes the indicator for the combined pedal (brakes or clutch) will become stuck in a non-neutral position when depressing the accelerator. This seems to be because new-lg4ff sends an event for the combined pedal when pressing the accelerator for the first time, and I don't know if this is really fixable from this end. |
Thanks for the contribution! It looks good. I've been thinking to use UInput for other reasons. Mainly to create a virtual device that combined several ones: wheel, pedals, shifter, handbrake, button pads, etc. And to a lesser extent, to move some new-lg4ff functionality here like you said, that way more drivers would be supported. I didn't use it because combining several devices would require many changes to the UI, thus a lot of work to make it simple. I'm also worried about device detection since the real device can't be hidden and the virtual device might not be correctly identified. I might use this as a starting point to test virtual devices. Have you done some testing in games/Proton?
You might be talking about: Line 391 in 4039565
Here I'm converting the X axis from 10bits to 16bits. AFAIK it's not an 8bit pedal value. Don't worry about the UI. I'm revising it anyway when new elements are added so it's held compact. Sadly, I don't have any tests or testing framework. It should be my job to start writing tests for the most basic things. Are all those pedal modes really needed or is it just because we can? I know it's easy to implement but won't they make the UI more hard to understand? Are we implementing the things people really might need and expect? I'm not sure how this new feature will interact with "combine pedals". Should we merge them?
I see the brakes pedal gets sometimes stuck at 50% while most times it's at 0% when switching to combine gas/brakes. Is that what you mean? I'll investigate. This might happen in the mainline kernel module too. |
A fair concern. Are you thinking from the user side or the games themselves? I imagine most games would display both, and you would then probably need to unbind at least the pedals from your real device in-game. From the user side it might be confusing with lots of features that use this UInput method. Maybe an explicit toggle of the virtual device in the UI is the key? That way the user will (hopefully) be aware that a virtual device is active, and then we can just grey out the unavailable options in the UI if a virtual device is required, but not enabled.
I have tested in-game through wine so I think it should work, but not specifically proton just yet. I will make sure to get some and try them out to be sure though. I'm fairly new to racing games, so I don't have much of a library at the moment.
Very possible that some of these are not needed, but what people think they need and what they actually need are not always one and the same. I initially thought I needed to simply invert the axis to get TM working for example, but what I actually needed is what's currently known as The
I'm not sure exactly what you mean by this? Currently this setup works with combine pedals for me in that if you combine clutch and accelerate and select We could include combined pedals in the virtual device of course if that's what you meant.
Ah, I see. I just saw a bunch of references to
Yep, that's it! No big deal I should think, and it's very possible that it comes from the upstream module like you said. Thanks for the feedback! I'll do some more testing and see if I can support more ranges than 0-255 for now. |
Some games detect your wheel and automatically apply a given settings profile. Some may list only devices detected as wheels or that resemble wheels. I wonder how those games might behave when presented with a wheel device they can't use and a "custom" device.
What do you mean? The steering wheel axis uses a different number of bits depending on the device, but pedals seem to use always only 8 bits, at least for the currently supported devices. |
thrustmaster T3PA goes in range 0-1023, so I can test that part. Still I think this needs #131, will try to get in sync with this and put changes to deal with different vendors on top of this |
Different vendors are already dealt with in the master branch. This PR creates a virtual device that works as a modified real device. This isn't needed for #131. |
I check patch and is mostly working. @Lars-Saetaberget you forget to process data all the time:
and for different values we just need to adjust the value depending on vendor (I guess):
in any case, pedal_mode is a mock for what driver should provide right? there's no wrapper function in oversteer that changes the final input, right? |
Overview
This change allows users to change how their pedal axes behave, such as inverting the axes, making them start out centered etc.
This is useful in certain games where the axes are not treated properly, and there is no option to change it in-game, such as in Trackmania. Some of the modes might seem quite strange, but I added some of these with combined pedals in mind, even though I don't have much experience with flying games, so I don't know how useful they will be.
Injector device
Ideally this should probably be done on an individual driver level, and I started by looking into doing this in new-lg4ff, but doing it in oversteer directly does allow us to create this functionality even for devices that do not have a built-in option for it. This should also allow us to do other things such as enable combined pedal support for devices with no option to combine pedals. In the future, checks could be implemented to see if the driver supports it natively, and if not, then we use the injector device method.
There are a couple of negatives to doing this in oversteer however:
Input needed
I created this PR as a draft as it is close, but not yet fully complete, and I require some input and guidance to put the last finishing touches on this:
wid.LG_WFG
andwid.LG_WFFG
only have 4 different values for their pedals for instance? (This is judging from what happens in device.py:normalize_event() )Other stuff
Any refactoring, logic changes etc. that do not fall into any of the above categories are of course also welcome.
Thanks for reading my wall of text!