mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
Fixed the crash that would occur when the Refresh button was pressed in the controllers config.
- Simplified the locking mechanism when controllers were updated - Reloaded the config of the controls instead of re-initialising the control plugins - Fixed controls being unresponsive after the Refresh button was pressed - Disables the hotkeys while the controller config is open
This commit is contained in:
@ -45,6 +45,11 @@ void Initialize(void* const hwnd)
|
||||
s_config.LoadConfig(true);
|
||||
}
|
||||
|
||||
void LoadConfig()
|
||||
{
|
||||
s_config.LoadConfig(true);
|
||||
}
|
||||
|
||||
void GetStatus(u8 _port, KeyboardStatus* _pKeyboardStatus)
|
||||
{
|
||||
memset(_pKeyboardStatus, 0, sizeof(*_pKeyboardStatus));
|
||||
@ -52,19 +57,6 @@ void GetStatus(u8 _port, KeyboardStatus* _pKeyboardStatus)
|
||||
|
||||
std::unique_lock<std::recursive_mutex> lk(s_config.controls_lock, std::try_to_lock);
|
||||
|
||||
if (!lk.owns_lock())
|
||||
{
|
||||
// if gui has lock (messing with controls), skip this input cycle
|
||||
// center axes and return
|
||||
_pKeyboardStatus->key0x = 0;
|
||||
_pKeyboardStatus->key1x = 0;
|
||||
_pKeyboardStatus->key2x = 0;
|
||||
_pKeyboardStatus->key3x = 0;
|
||||
_pKeyboardStatus->key4x = 0;
|
||||
_pKeyboardStatus->key5x = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// get input
|
||||
((GCKeyboard*)s_config.controllers[_port])->GetInput(_pKeyboardStatus);
|
||||
}
|
||||
|
Reference in New Issue
Block a user