From 2c5532f4ab0d0bf4ce5a4bc376cf8bb5fb803f11 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 10 Dec 2017 13:43:05 -0500 Subject: add e.IsSuppressed to input event args --- src/SMAPI/Events/EventArgsInput.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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 /// Whether the input should use tools on the affected tile. public bool IsUseToolButton { get; } + /// Whether a mod has indicated the key was already handled. + public bool IsSuppressed { get; private set; } + /********* ** Public methods @@ -55,6 +58,9 @@ namespace StardewModdingAPI.Events /// The button to suppress. 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()); -- cgit