Allow input configuration with SDL joysticks (#3116)
* Add infrastructure to poll joystick input and get ParamPackages * Generalize the callbacks in configure_input.cpp and add buttons for analog sticks * Use the polling classes in the input dialog * Fix includes * Formatting fix * Include real header instead of forward declaring, to fix compiler error * Split up pair and add deadzone for joystick configuration * Pass ParamPackages by reference to callback * fix formatting * getPollers -> GetPollers * Add forward declarations and simplify code a bit * Update joysticks before opening them * Fix mixup between joystick IDs and device indices
This commit is contained in:
parent
e165b5bb94
commit
e784434a25
7 changed files with 385 additions and 52 deletions
|
@ -71,4 +71,15 @@ std::string GenerateAnalogParamFromKeys(int key_up, int key_down, int key_left,
|
|||
return circle_pad_param.Serialize();
|
||||
}
|
||||
|
||||
namespace Polling {
|
||||
|
||||
std::vector<std::unique_ptr<DevicePoller>> GetPollers(DeviceType type) {
|
||||
#ifdef HAVE_SDL2
|
||||
return SDL::Polling::GetPollers(type);
|
||||
#else
|
||||
return {};
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Polling
|
||||
} // namespace InputCommon
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue