diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-03-08 11:45:55 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-03-08 11:45:55 -0400 |
commit | 29fdf9ae4a91131f758035ab79fbfe0595ff1eca (patch) | |
tree | 4986787e17dc7d7da76679fc14c1c724802cf2bf /src/SMAPI/Framework/ModHelpers | |
parent | 1b282f950ad068fef581fbebba493ca9f952a5c7 (diff) | |
download | SMAPI-29fdf9ae4a91131f758035ab79fbfe0595ff1eca.tar.gz SMAPI-29fdf9ae4a91131f758035ab79fbfe0595ff1eca.tar.bz2 SMAPI-29fdf9ae4a91131f758035ab79fbfe0595ff1eca.zip |
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.
Diffstat (limited to 'src/SMAPI/Framework/ModHelpers')
-rw-r--r-- | src/SMAPI/Framework/ModHelpers/InputHelper.cs | 4 |
1 files changed, 2 insertions, 2 deletions
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 /// <param name="button">The button.</param> public bool IsSuppressed(SButton button) { - return this.InputState.SuppressButtons.Contains(button); + return this.InputState.IsSuppressed(button); } /// <summary>Prevent the game from handling a button press. This doesn't prevent other mods from receiving the event.</summary> /// <param name="button">The button to suppress.</param> public void Suppress(SButton button) { - this.InputState.SuppressButtons.Add(button); + this.InputState.OverrideButton(button, setDown: false); } /// <summary>Get the state of a button.</summary> |