summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Events
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/Events')
-rw-r--r--src/SMAPI/Framework/Events/EventManager.cs4
-rw-r--r--src/SMAPI/Framework/Events/ModInputEvents.cs7
2 files changed, 11 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs
index 665dbfe3..f4abfffe 100644
--- a/src/SMAPI/Framework/Events/EventManager.cs
+++ b/src/SMAPI/Framework/Events/EventManager.cs
@@ -93,6 +93,9 @@ namespace StardewModdingAPI.Framework.Events
/****
** Input
****/
+ /// <summary>Raised after the player presses or releases any buttons on the keyboard, controller, or mouse.</summary>
+ public readonly ManagedEvent<ButtonsChangedEventArgs> ButtonsChanged;
+
/// <summary>Raised after the player presses a button on the keyboard, controller, or mouse.</summary>
public readonly ManagedEvent<ButtonPressedEventArgs> ButtonPressed;
@@ -212,6 +215,7 @@ namespace StardewModdingAPI.Framework.Events
this.TimeChanged = ManageEventOf<TimeChangedEventArgs>(nameof(IModEvents.GameLoop), nameof(IGameLoopEvents.TimeChanged));
this.ReturnedToTitle = ManageEventOf<ReturnedToTitleEventArgs>(nameof(IModEvents.GameLoop), nameof(IGameLoopEvents.ReturnedToTitle));
+ this.ButtonsChanged = ManageEventOf<ButtonsChangedEventArgs>(nameof(IModEvents.Input), nameof(IInputEvents.ButtonsChanged));
this.ButtonPressed = ManageEventOf<ButtonPressedEventArgs>(nameof(IModEvents.Input), nameof(IInputEvents.ButtonPressed));
this.ButtonReleased = ManageEventOf<ButtonReleasedEventArgs>(nameof(IModEvents.Input), nameof(IInputEvents.ButtonReleased));
this.CursorMoved = ManageEventOf<CursorMovedEventArgs>(nameof(IModEvents.Input), nameof(IInputEvents.CursorMoved), isPerformanceCritical: true);
diff --git a/src/SMAPI/Framework/Events/ModInputEvents.cs b/src/SMAPI/Framework/Events/ModInputEvents.cs
index ab26ab3e..6f423e5d 100644
--- a/src/SMAPI/Framework/Events/ModInputEvents.cs
+++ b/src/SMAPI/Framework/Events/ModInputEvents.cs
@@ -9,6 +9,13 @@ namespace StardewModdingAPI.Framework.Events
/*********
** Accessors
*********/
+ /// <summary>Raised after the player presses or releases any buttons on the keyboard, controller, or mouse.</summary>
+ public event EventHandler<ButtonsChangedEventArgs> ButtonsChanged
+ {
+ add => this.EventManager.ButtonsChanged.Add(value, this.Mod);
+ remove => this.EventManager.ButtonsChanged.Remove(value);
+ }
+
/// <summary>Raised after the player presses a button on the keyboard, controller, or mouse.</summary>
public event EventHandler<ButtonPressedEventArgs> ButtonPressed
{