#if !SMAPI_3_0_STRICT using System; using StardewModdingAPI.Framework; using StardewModdingAPI.Framework.Events; namespace StardewModdingAPI.Events { /// Events raised when the player uses a controller, keyboard, or mouse button. [Obsolete("Use " + nameof(Mod.Helper) + "." + nameof(IModHelper.Events) + " instead. See https://smapi.io/3.0 for more info.")] public static class InputEvents { /********* ** Fields *********/ /// The core event manager. private static EventManager EventManager; /********* ** Events *********/ /// Raised when the player presses a button on the keyboard, controller, or mouse. public static event EventHandler ButtonPressed { add { SCore.DeprecationManager.WarnForOldEvents(); InputEvents.EventManager.Legacy_ButtonPressed.Add(value); } remove => InputEvents.EventManager.Legacy_ButtonPressed.Remove(value); } /// Raised when the player releases a keyboard key on the keyboard, controller, or mouse. public static event EventHandler ButtonReleased { add { SCore.DeprecationManager.WarnForOldEvents(); InputEvents.EventManager.Legacy_ButtonReleased.Add(value); } remove => InputEvents.EventManager.Legacy_ButtonReleased.Remove(value); } /********* ** Public methods *********/ /// Initialise the events. /// The core event manager. internal static void Init(EventManager eventManager) { InputEvents.EventManager = eventManager; } } } #endif