Introduce inheritable Profiles and Managers

- There's always a single Profile choosen
- There are many Managers changing settings
  depending on environment
- Improve and re-use mappings between profiles
- Introduce Steam Profile to be used when
  in Steam Big Picture or Steam Game
This commit is contained in:
Kamil Trzciński 2022-11-25 10:56:17 +01:00
parent 10d6c055da
commit ab5bc370df
21 changed files with 530 additions and 311 deletions

View file

@ -22,10 +22,13 @@ namespace SteamController.Devices
{
// We need to explicitly disable lizard every some time
// but don't fight enabling it, as someone else might be taking control (Steam?)
if (LizardMouse || lizardMouseUpdated.AddMilliseconds(LizardModeUpdateInterval) > DateTime.Now)
if (lizardMouseUpdated.AddMilliseconds(LizardModeUpdateInterval) > DateTime.Now)
return;
}
savedLizardMouse = LizardMouse;
lizardMouseUpdated = DateTime.Now;
if (LizardMouse)
{
//Enable mouse emulation
@ -38,9 +41,6 @@ namespace SteamController.Devices
byte[] data = new byte[] { 0x87, 0x03, 0x08, 0x07 };
neptuneDevice.RequestFeatureReport(data);
}
savedLizardMouse = LizardMouse;
lizardMouseUpdated = DateTime.Now;
}
private void UpdateLizardButtons()
@ -49,10 +49,13 @@ namespace SteamController.Devices
{
// We need to explicitly disable lizard every some time
// but don't fight enabling it, as someone else might be taking control (Steam?)
if (LizardButtons || lizardButtonUpdated.AddMilliseconds(LizardModeUpdateInterval) > DateTime.Now)
if (lizardButtonUpdated.AddMilliseconds(LizardModeUpdateInterval) > DateTime.Now)
return;
}
savedLizardButtons = LizardButtons;
lizardButtonUpdated = DateTime.Now;
if (LizardButtons)
{
//Enable keyboard/mouse button emulation
@ -65,9 +68,6 @@ namespace SteamController.Devices
byte[] data = new byte[] { 0x81, 0x00 };
neptuneDevice.RequestFeatureReport(data);
}
savedLizardButtons = LizardButtons;
lizardButtonUpdated = DateTime.Now;
}
}
}