summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModHelpers/InputHelper.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-22 21:05:04 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-22 21:05:04 -0500
commitd0dc3ea6f6d03e6aabdab5f5f10a60177f0e53b6 (patch)
tree02896d970c7650d8f7c8b84f54e53eddab88b4ca /src/SMAPI/Framework/ModHelpers/InputHelper.cs
parent5953fc3bd083ae0a579d2da1ad833e6163848086 (diff)
parent733750fdc4f5d16069d95880144619c0e31e8a89 (diff)
downloadSMAPI-d0dc3ea6f6d03e6aabdab5f5f10a60177f0e53b6.tar.gz
SMAPI-d0dc3ea6f6d03e6aabdab5f5f10a60177f0e53b6.tar.bz2
SMAPI-d0dc3ea6f6d03e6aabdab5f5f10a60177f0e53b6.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/ModHelpers/InputHelper.cs')
-rw-r--r--src/SMAPI/Framework/ModHelpers/InputHelper.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModHelpers/InputHelper.cs b/src/SMAPI/Framework/ModHelpers/InputHelper.cs
index e1317544..88caf4c3 100644
--- a/src/SMAPI/Framework/ModHelpers/InputHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/InputHelper.cs
@@ -1,5 +1,6 @@
using System;
using StardewModdingAPI.Framework.Input;
+using StardewModdingAPI.Utilities;
namespace StardewModdingAPI.Framework.ModHelpers
{
@@ -50,6 +51,19 @@ namespace StardewModdingAPI.Framework.ModHelpers
}
/// <inheritdoc />
+ public void SuppressActiveKeybinds(KeybindList keybindList)
+ {
+ foreach (Keybind keybind in keybindList.Keybinds)
+ {
+ if (!keybind.GetState().IsDown())
+ continue;
+
+ foreach (SButton button in keybind.Buttons)
+ this.Suppress(button);
+ }
+ }
+
+ /// <inheritdoc />
public SButtonState GetState(SButton button)
{
return this.CurrentInputState().GetState(button);