From b93c1414c1ca5765075f17f60c1a265a1eed7b3c Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 27 Mar 2014 01:21:05 +0000 Subject: [PATCH] A fix to joypad.set() - passing null will clear a button --- BizHawk.Client.Common/lua/EmuLuaLibrary.Joypad.cs | 3 ++- BizHawk.Client.Common/movie/InputAdapters.cs | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Joypad.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Joypad.cs index 0d5f73b523..401f29d264 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Joypad.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Joypad.cs @@ -121,7 +121,8 @@ namespace BizHawk.Client.Common } else { - Global.ForceOffAdaptor.SetSticky(button.ToString(), false); + Global.StickyXORAdapter.Unset(button.ToString()); + Global.ForceOffAdaptor.Unset(button.ToString()); } } else // Inverse diff --git a/BizHawk.Client.Common/movie/InputAdapters.cs b/BizHawk.Client.Common/movie/InputAdapters.cs index 1259f9a315..7ba9620c7f 100644 --- a/BizHawk.Client.Common/movie/InputAdapters.cs +++ b/BizHawk.Client.Common/movie/InputAdapters.cs @@ -244,6 +244,11 @@ namespace BizHawk.Client.Common this.StickySet.Remove(button); } } + + public void Unset(string button) + { + StickySet.Remove(button); + } } 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) { return stickySet.Contains(button);