-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
Added keyboard and mouse input remapping, rudimentary mouse movement to joystick logic and more #1356
base: main
Are you sure you want to change the base?
Conversation
use relative path for the ini file
and fixed platform-dependent code
Update: |
i have some doubt for mouse . Most games calls sceMouse lib library to do it natively . check draft #633 |
Well for the games that support it just disable this? I wrote this specifically for Bloodborne that doesn't have support, and there, this works fine. I know that this isn't the cleanest option, but for some games you use either this or nothing |
well sure bb what else :D . Need to check how to have both working . Maybe have an config option to enable/disable this |
I checked the libMouse branch, and it looks like it can coexist with this, even without manual config other than not adding mouse bindings to my keyboardInputConfig.ini file like this:
and this is yours:
These can be merged into one, and while I haven't tested this, this will probably work fine, since they use different things, and the overhead of checking mouse input both ways is probably negligible.
|
What are the new controls and how do I change them? I really wanna take the X O Square and Triangle buttons off the Numpad. That would help a lot! |
You can find the new bindings in the user/keyboardInputConfig.ini file, and they are already changed. To use it, just copy it to your user/ directory and you are good to go, and the syntax is fairly straightforward |
Quick notice, as it stands now mouse wheel support is incompatible with Logitech mouse software due to an unknown bug (the wheel inputs don't get registered correctly, the rest work fine) |
src/sdl_window.cpp
Outdated
using Libraries::Pad::OrbisPadButtonDataOffset; | ||
|
||
// i wrapped it in a function so I can collapse it | ||
std::string getDefaultKeyboardConfig() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be a separate header, and a constexpr std::string_view so it has no runtime overhead
src/sdl_window.cpp
Outdated
} | ||
|
||
// Button map: maps key+modifier to controller button | ||
std::map<KeyBinding, u32> button_map = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These dont belong in a windows class, please separate them in the input/ directory ideally
src/sdl_window.cpp
Outdated
return state; | ||
} | ||
|
||
void parseInputConfig(const std::string game_id = "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
void parseInputConfig(const std::string game_id = "") { | |
void parseInputConfig(std::string_view game_id = "") { |
I'm currently rewriting this (yet again) to make inputs update flags, and then update the virtual controller from said flags to make things like wasd-to-joystick better (example: currently pressing a+d, then releasing d will stop the player even though a is still pressed), I'll incorporate these into that update. |
At this point, I think the rewrite is in a good enough state for people to start using. More 1000 lines of code translates to about 6 changes for the end user, so here they are:
|
Build abc1fa2 And there is also such a moment: 2024-11-15.17-44-06.mp4I tested it for literally 10 minutes and only Bloodborne, I did not check other functions. |
Thanks for the feedback! As for impossible-to-guess keybind names, they can be found on the qt-config-gui branch in the Help section, so it's not completely hidden. For your video, I was able to replicate it myself: it seems that if you hold both a and d or w and s, the joystick input is also activated. |
I changed the original hard-coded switch case keyboard inputs to handling keyboard key - controller button pairs with std::map-s, to which the input pairs get loaded to from a file in the user/ directory (currently hard-coded to keyboardInputConfig.ini).
Mouse movement is baked to the right joystick at the moment, and is handled by polling the mouse delta position.
I didn't touch the other input modes only the keyboard, to which i also put mouse input too.
The provided ini file currently has a souls inspired bloodborne layout.
I also added a robust multi-key input system that is able to accept a key-modifier key pair as input.
F8 reparses the config file and you can even change inputs while ingame
F9 toggles mouse capture