Menu button alt layout - #6
Conversation
|
Ok, let us know if it is ready for review or if you have any questions.
Sounds good.
I'd suggest making this configurable. I agree that the menu button is probably the better choice, but I would like to keep at least the default button combinations the same as under Steam. |
I wouldn't mind your opinions on the state of it now. A bunch of the functions were made mutable which I am not keen on, but I'm not sure what the best way forward is |
|
Correct me if I am wrong, but the only two functions causing all other functions to require mutability are For the first one, we could generate a layer change event and propagate that up the call chain so only the function handling this event has to be mutable. We could perhaps also move the current layout into the device state. For the Regardless of the mutability "problem" it might also make sense to move all the |
This is not finished but I figured I'd open this now to discuss how this should be implemented.
The basic idea is to treat the virtual controller
ControllerInputas an idealised input rather than 1:1 the current state of the controller, and then handle the alt layout insteam_controller.rs.I also propose using the menu button instead of the steam button for this, as the menu button has no equivalent on an xbox controller (which is what this is emulating) and it means the steam controller doesn't turn off if the alt layout button is held for too long.
This is currently just using an
alt_modeboolean but I could imagine this being done with some kind of runtime modifiable map, which might also make it easier to allow custom bindings.