using System; using StardewModdingAPI.Framework.Events; namespace StardewModdingAPI.Events { /// Events raised when the player uses a controller, keyboard, or mouse button. public static class InputEvents { /********* ** Properties *********/ /// 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 => InputEvents.EventManager.Legacy_Input_ButtonPressed.Add(value); remove => InputEvents.EventManager.Legacy_Input_ButtonPressed.Remove(value); } /// Raised when the player releases a keyboard key on the keyboard, controller, or mouse. public static event EventHandler ButtonReleased { add => InputEvents.EventManager.Legacy_Input_ButtonReleased.Add(value); remove => InputEvents.EventManager.Legacy_Input_ButtonReleased.Remove(value); } /********* ** Public methods *********/ /// Initialise the events. /// The core event manager. internal static void Init(EventManager eventManager) { InputEvents.EventManager = eventManager; } } }