A fix to joypad.set() - passing null will clear a button

This commit is contained in:
adelikat 2014-03-27 01:21:05 +00:00
parent ddb9d6ccf2
commit b93c1414c1
2 changed files with 12 additions and 1 deletions

View File

@ -121,7 +121,8 @@ namespace BizHawk.Client.Common
} }
else else
{ {
Global.ForceOffAdaptor.SetSticky(button.ToString(), false); Global.StickyXORAdapter.Unset(button.ToString());
Global.ForceOffAdaptor.Unset(button.ToString());
} }
} }
else // Inverse else // Inverse

View File

@ -244,6 +244,11 @@ namespace BizHawk.Client.Common
this.StickySet.Remove(button); this.StickySet.Remove(button);
} }
} }
public void Unset(string button)
{
StickySet.Remove(button);
}
} }
public class StickyXorAdapter : IController public class StickyXorAdapter : IController
@ -315,6 +320,11 @@ namespace BizHawk.Client.Common
} }
} }
public void Unset(string button)
{
stickySet.Remove(button);
}
public bool IsSticky(string button) public bool IsSticky(string button)
{ {
return stickySet.Contains(button); return stickySet.Contains(button);