summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Events/ModInputEvents.cs
blob: 40edf806cbc146946f44d1aa2d089225f0e6fdee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using StardewModdingAPI.Events;

namespace StardewModdingAPI.Framework.Events
{
    /// <inheritdoc cref="IInputEvents" />
    internal class ModInputEvents : ModEventsBase, IInputEvents
    {
        /*********
        ** Accessors
        *********/
        /// <inheritdoc />
        public event EventHandler<ButtonsChangedEventArgs> ButtonsChanged
        {
            add => this.EventManager.ButtonsChanged.Add(value, this.Mod);
            remove => this.EventManager.ButtonsChanged.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<ButtonPressedEventArgs> ButtonPressed
        {
            add => this.EventManager.ButtonPressed.Add(value, this.Mod);
            remove => this.EventManager.ButtonPressed.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<ButtonReleasedEventArgs> ButtonReleased
        {
            add => this.EventManager.ButtonReleased.Add(value, this.Mod);
            remove => this.EventManager.ButtonReleased.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<CursorMovedEventArgs> CursorMoved
        {
            add => this.EventManager.CursorMoved.Add(value, this.Mod);
            remove => this.EventManager.CursorMoved.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<MouseWheelScrolledEventArgs> MouseWheelScrolled
        {
            add => this.EventManager.MouseWheelScrolled.Add(value, this.Mod);
            remove => this.EventManager.MouseWheelScrolled.Remove(value);
        }


        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="mod">The mod which uses this instance.</param>
        /// <param name="eventManager">The underlying event manager.</param>
        internal ModInputEvents(IModMetadata mod, EventManager eventManager)
            : base(mod, eventManager) { }
    }
}