PAD: Call SDL_GameControllerUpdate during pad testing

This commit is contained in:
TellowKrinkle 2021-12-01 15:00:47 -06:00 committed by tellowkrinkle
parent cf176f1b99
commit 5d6f0d7e47
2 changed files with 8 additions and 0 deletions

View File

@ -49,6 +49,7 @@ GamepadConfiguration::GamepadConfiguration(int pad, wxWindow* parent)
gamepad_box->Add(rumble_box, wxSizerFlags().Expand().Border(wxALL, 5));
gamepad_box->Add(joy_box, wxSizerFlags().Expand().Border(wxALL, 5));
Bind(wxEVT_UPDATE_UI, &GamepadConfiguration::OnUpdateEvent, this);
Bind(wxEVT_SCROLL_THUMBRELEASE, &GamepadConfiguration::OnSliderReleased, this);
Bind(wxEVT_CHECKBOX, &GamepadConfiguration::OnCheckboxChange, this);
Bind(wxEVT_CHOICE, &GamepadConfiguration::OnChoiceChange, this);
@ -96,6 +97,12 @@ void GamepadConfiguration::InitGamepadConfiguration()
}
}
void GamepadConfiguration::OnUpdateEvent(wxCommandEvent& event)
{
// Makes sure joystick rumble testing works properly
SDL_GameControllerUpdate();
}
/**
* Slider event, called when the use release the slider button
* @FIXME The current solution can't change the joystick sensibility and the rumble intensity

View File

@ -37,6 +37,7 @@ class GamepadConfiguration : public wxDialog
void repopulate();
// Events
void OnUpdateEvent(wxCommandEvent&);
void OnSliderReleased(wxCommandEvent&);
void OnCheckboxChange(wxCommandEvent&);
void OnChoiceChange(wxCommandEvent&);