From 29fdf9ae4a91131f758035ab79fbfe0595ff1eca Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 8 Mar 2020 11:45:55 -0400 Subject: rework input handling to allow sending custom input to the game/mods That will let Virtual Keyboard on Android work with the future multi-key binding API, and with mods that check input state directly (e.g. Pathoschild/StardewMods#520). It might also be useful as a public API in future versions. --- src/SMAPI/Framework/ModHelpers/InputHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/SMAPI/Framework/ModHelpers/InputHelper.cs') diff --git a/src/SMAPI/Framework/ModHelpers/InputHelper.cs b/src/SMAPI/Framework/ModHelpers/InputHelper.cs index f8ff0355..134ba8d1 100644 --- a/src/SMAPI/Framework/ModHelpers/InputHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/InputHelper.cs @@ -41,14 +41,14 @@ namespace StardewModdingAPI.Framework.ModHelpers /// The button. public bool IsSuppressed(SButton button) { - return this.InputState.SuppressButtons.Contains(button); + return this.InputState.IsSuppressed(button); } /// Prevent the game from handling a button press. This doesn't prevent other mods from receiving the event. /// The button to suppress. public void Suppress(SButton button) { - this.InputState.SuppressButtons.Add(button); + this.InputState.OverrideButton(button, setDown: false); } /// Get the state of a button. -- cgit