Input: Turn off hot plugging for directinput devices
Loading a game or opening input config will still check for new DInput controllers
This commit is contained in:
parent
bf76bb3579
commit
857caa3e20
3 changed files with 7 additions and 3 deletions
|
@ -371,6 +371,7 @@ bool Console::LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom)
|
||||||
shared_ptr<BaseCartridge> cart = BaseCartridge::CreateCartridge(this, romFile, patchFile);
|
shared_ptr<BaseCartridge> cart = BaseCartridge::CreateCartridge(this, romFile, patchFile);
|
||||||
if(cart) {
|
if(cart) {
|
||||||
if(stopRom) {
|
if(stopRom) {
|
||||||
|
KeyManager::UpdateDevices();
|
||||||
Stop(false);
|
Stop(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,10 @@ namespace Mesen.GUI.Forms.Config
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Task.Run(() => {
|
||||||
|
InputApi.UpdateInputDevices();
|
||||||
|
});
|
||||||
|
|
||||||
InputConfig cfg = ConfigManager.Config.Input.Clone();
|
InputConfig cfg = ConfigManager.Config.Input.Clone();
|
||||||
Entity = cfg;
|
Entity = cfg;
|
||||||
|
|
||||||
|
|
|
@ -254,12 +254,11 @@ void WindowsKeyManager::StartUpdateDeviceThread()
|
||||||
_directInput.reset(new DirectInputManager(_console, _hWnd));
|
_directInput.reset(new DirectInputManager(_console, _hWnd));
|
||||||
|
|
||||||
while(!_stopUpdateDeviceThread) {
|
while(!_stopUpdateDeviceThread) {
|
||||||
//Check for newly plugged in controllers every 5 secs (this takes ~60-70ms when no new controllers are found)
|
//Check for newly plugged in XInput controllers every 5 secs
|
||||||
|
//Do not check for DirectInput controllers because this takes more time and sometimes causes issues/freezes
|
||||||
if(_xInput->NeedToUpdate()) {
|
if(_xInput->NeedToUpdate()) {
|
||||||
_xInput->UpdateDeviceList();
|
_xInput->UpdateDeviceList();
|
||||||
}
|
}
|
||||||
_directInput->UpdateDeviceList();
|
|
||||||
|
|
||||||
_stopSignal.Wait(5000);
|
_stopSignal.Wait(5000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue