Skip to content
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

ControlMapper refactoring #17210

Merged
merged 18 commits into from
Apr 1, 2023
Merged

ControlMapper refactoring #17210

merged 18 commits into from
Apr 1, 2023

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Mar 30, 2023

This will make it easier to implement multi-input combo mappings as in #14793 . This PR doesn't implement it though, only lays the ground work.

Basically, we flip the entire mapping algorithm on its head - instead of taking an input all the way through, we recompute the related outputs from stored inputs on every input change. This will make combos very easy to implement.

Also, analog virtual keys are now more general and handled by the mapper (including conversion of signed axis to unsigned, as required by PS4 controller triggers on DInput), so VIRTKEY_SPEED_ANALOG is now much simpler.

@hrydgard hrydgard added the Input/Controller Input and controller issues label Mar 30, 2023
@hrydgard hrydgard added this to the v1.15.0 milestone Mar 30, 2023
@hrydgard hrydgard added the Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. label Mar 30, 2023
@hrydgard hrydgard marked this pull request as draft March 30, 2023 13:21
@hrydgard hrydgard marked this pull request as ready for review March 30, 2023 20:17
@hrydgard
Copy link
Owner Author

This is largely working. There's still some non-ideal behavior when trying to control the analog stick from keyboard and a gamepad simultaneously which I'll try to sort out before merge, but other than that, this is ready for review now I think.

@hrydgard hrydgard force-pushed the control-mapping-refactor branch from 3558139 to 778d9ac Compare March 31, 2023 09:06
@hrydgard
Copy link
Owner Author

I tried prototyping multi-mapping on top of this, and it comes out pretty well and quite flexible (including more than 2-inputs combos).

Just a little polish left here then I think we can get it in.

@hrydgard
Copy link
Owner Author

Alright, polish done. Works fine now, and solves an old issue when using both gamepad and keyboard together.

UI/EmuScreen.cpp Outdated Show resolved Hide resolved
Core/HLE/sceCtrl.h Outdated Show resolved Hide resolved
Core/ControlMapper.cpp Outdated Show resolved Hide resolved
Core/Debugger/WebSocket/InputSubscriber.cpp Outdated Show resolved Hide resolved
Core/ControlMapper.cpp Outdated Show resolved Hide resolved
Core/ControlMapper.cpp Outdated Show resolved Hide resolved
@unknownbrackets unknownbrackets merged commit a6bf499 into master Apr 1, 2023
@unknownbrackets unknownbrackets deleted the control-mapping-refactor branch April 1, 2023 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. Input/Controller Input and controller issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants