move some logic from mainform to InputManager
This commit is contained in:
parent
a3c586b480
commit
910c37d434
|
@ -73,6 +73,17 @@ namespace BizHawk.Client.Common
|
||||||
ControllerOutput.Source = session.MovieOut;
|
ControllerOutput.Source = session.MovieOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ToggleStickies()
|
||||||
|
{
|
||||||
|
StickyXorAdapter.MassToggleStickyState(ActiveController.PressedButtons);
|
||||||
|
AutofireStickyXorAdapter.MassToggleStickyState(AutoFireController.PressedButtons);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToggleAutoStickies()
|
||||||
|
{
|
||||||
|
AutofireStickyXorAdapter.MassToggleStickyState(ActiveController.PressedButtons);
|
||||||
|
}
|
||||||
|
|
||||||
private static Controller BindToDefinition(ControllerDefinition def, IDictionary<string, Dictionary<string, string>> allBinds, IDictionary<string, Dictionary<string, AnalogBind>> analogBinds)
|
private static Controller BindToDefinition(ControllerDefinition def, IDictionary<string, Dictionary<string, string>> allBinds, IDictionary<string, Dictionary<string, AnalogBind>> analogBinds)
|
||||||
{
|
{
|
||||||
var ret = new Controller(def);
|
var ret = new Controller(def);
|
||||||
|
|
|
@ -669,12 +669,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
if (InputManager.ClientControls["Autohold"])
|
if (InputManager.ClientControls["Autohold"])
|
||||||
{
|
{
|
||||||
InputManager.StickyXorAdapter.MassToggleStickyState(InputManager.ActiveController.PressedButtons);
|
InputManager.ToggleStickies();
|
||||||
InputManager.AutofireStickyXorAdapter.MassToggleStickyState(InputManager.AutoFireController.PressedButtons);
|
|
||||||
}
|
}
|
||||||
else if (InputManager.ClientControls["Autofire"])
|
else if (InputManager.ClientControls["Autofire"])
|
||||||
{
|
{
|
||||||
InputManager.AutofireStickyXorAdapter.MassToggleStickyState(InputManager.ActiveController.PressedButtons);
|
InputManager.ToggleAutoStickies();
|
||||||
}
|
}
|
||||||
|
|
||||||
// autohold/autofire must not be affected by the following inputs
|
// autohold/autofire must not be affected by the following inputs
|
||||||
|
|
Loading…
Reference in New Issue