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

KBM-only remapping #1797

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

kalaposfos13
Copy link
Contributor

This is a modified version of my remapping PR that only contains the keyboard and mouse part, as this is already complete and has proven to be mostly bug-free, as it has been extensively tested by people using @diegolix29's fork. The controller part is still WIP and is not ready for merging yet, so until that's ready too, I'll just put this out here following @rainmakerv3's advice. The code still has some controller remapping elements left in, but they aren't hooked up to the main input loop. If I left in anything that I shouldn't have, please let me know.

@rainmakerv3
Copy link
Contributor

rainmakerv3 commented Dec 16, 2024

image

This was my attempt at designing a GUI for this. Since there's so many functions (ability to add up to 3 inputs per output is the most painful one to design), I can't seem to make it take a smaller space.

The intended use for this is that the dropdown boxes list down the possible inputs per output (since there can be up to three), and the user can press the corresponding input button, then input up to three keystrokes to fill in each combobox. Design wise this seems to be the only thing I can think of to support the things this program wants to do, but I am unable to code it this way.

As such, I'm at least putting the UI file here, and maybe someone else can code in the input saving and such.

(saved as txt file, rename to ui to use)

kbm_config_dialog.txt

@GHU7924
Copy link

GHU7924 commented Dec 16, 2024

@rainmakerv3 I think it's worth combining at least the keyboard, since some people can play on laptops or they don't have a controller, it should have been added a long time ago, and as for the graphical interface, we haven't made significant progress in this direction yet, let's leave it for later.

@rainmakerv3
Copy link
Contributor

Yes I agree. My thought is that this would be a good place to leave this for anyone who wants to use it. But like you, I also believe this is good enough to merge in its current state

src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/sdl_window.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
src/input/input_handler.cpp Outdated Show resolved Hide resolved
@kalaposfos13
Copy link
Contributor Author

@raphaelthegreat I did the easy changes, and I'll do the rest tomorrow. So far I've only one comment on this:
std::ranges::find does indeed do what my function does, but &*std::ranges::find(output_array, ControllerOutput(button_it->second)) just looks cursed.

@raphaelthegreat
Copy link
Collaborator

raphaelthegreat commented Dec 20, 2024

You can use projections in ranges to simplify it to

const auto it = std::ranges::find(output_array, &ControllerOutput::button, button_it->second);
return &*it;

@kalaposfos13
Copy link
Contributor Author

Well I finally resolved everything in the review, hopefully nothing got broken along the way.

| L2 | Right Button |
| R2 | Left Button, LShift |
| L3 | X |
| R3 | Q / Middle Button |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants