using System;
using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
/// Events raised when the player provides input using a controller, keyboard, or mouse.
internal class ModInputEvents : ModEventsBase, IInputEvents
{
/*********
** Accessors
*********/
/// Raised after the player presses or releases any buttons on the keyboard, controller, or mouse.
public event EventHandler ButtonsChanged
{
add => this.EventManager.ButtonsChanged.Add(value, this.Mod);
remove => this.EventManager.ButtonsChanged.Remove(value);
}
/// Raised after the player presses a button on the keyboard, controller, or mouse.
public event EventHandler ButtonPressed
{
add => this.EventManager.ButtonPressed.Add(value, this.Mod);
remove => this.EventManager.ButtonPressed.Remove(value);
}
/// Raised after the player releases a button on the keyboard, controller, or mouse.
public event EventHandler ButtonReleased
{
add => this.EventManager.ButtonReleased.Add(value, this.Mod);
remove => this.EventManager.ButtonReleased.Remove(value);
}
/// Raised after the player moves the in-game cursor.
public event EventHandler CursorMoved
{
add => this.EventManager.CursorMoved.Add(value, this.Mod);
remove => this.EventManager.CursorMoved.Remove(value);
}
/// Raised after the player scrolls the mouse wheel.
public event EventHandler MouseWheelScrolled
{
add => this.EventManager.MouseWheelScrolled.Add(value, this.Mod);
remove => this.EventManager.MouseWheelScrolled.Remove(value);
}
/*********
** Public methods
*********/
/// Construct an instance.
/// The mod which uses this instance.
/// The underlying event manager.
internal ModInputEvents(IModMetadata mod, EventManager eventManager)
: base(mod, eventManager) { }
}
}