summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events/EventArgsInput.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-12-10 13:43:05 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-12-10 13:43:05 -0500
commit2c5532f4ab0d0bf4ce5a4bc376cf8bb5fb803f11 (patch)
treee2ef1b2f74537a15946d74b936430f5c08e902bf /src/SMAPI/Events/EventArgsInput.cs
parentdd7b5ac462f5be2d6bee9d61f243e5c32140f175 (diff)
downloadSMAPI-2c5532f4ab0d0bf4ce5a4bc376cf8bb5fb803f11.tar.gz
SMAPI-2c5532f4ab0d0bf4ce5a4bc376cf8bb5fb803f11.tar.bz2
SMAPI-2c5532f4ab0d0bf4ce5a4bc376cf8bb5fb803f11.zip
add e.IsSuppressed to input event args
Diffstat (limited to 'src/SMAPI/Events/EventArgsInput.cs')
-rw-r--r--src/SMAPI/Events/EventArgsInput.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/SMAPI/Events/EventArgsInput.cs b/src/SMAPI/Events/EventArgsInput.cs
index ee15fd27..a5325b76 100644
--- a/src/SMAPI/Events/EventArgsInput.cs
+++ b/src/SMAPI/Events/EventArgsInput.cs
@@ -28,6 +28,9 @@ namespace StardewModdingAPI.Events
/// <summary>Whether the input should use tools on the affected tile.</summary>
public bool IsUseToolButton { get; }
+ /// <summary>Whether a mod has indicated the key was already handled.</summary>
+ public bool IsSuppressed { get; private set; }
+
/*********
** Public methods
@@ -55,6 +58,9 @@ namespace StardewModdingAPI.Events
/// <param name="button">The button to suppress.</param>
public void SuppressButton(SButton button)
{
+ if (button == this.Button)
+ this.IsSuppressed = true;
+
// keyboard
if (button.TryGetKeyboard(out Keys key))
Game1.oldKBState = new KeyboardState(Game1.oldKBState.GetPressedKeys().Union(new[] { key }).ToArray());