summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Events/Controls.cs
diff options
context:
space:
mode:
Diffstat (limited to 'StardewModdingAPI/Events/Controls.cs')
-rw-r--r--StardewModdingAPI/Events/Controls.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/StardewModdingAPI/Events/Controls.cs b/StardewModdingAPI/Events/Controls.cs
new file mode 100644
index 00000000..ace890ca
--- /dev/null
+++ b/StardewModdingAPI/Events/Controls.cs
@@ -0,0 +1,31 @@
+using Microsoft.Xna.Framework.Input;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StardewModdingAPI.Events
+{
+ public static class ControlEvents
+ {
+ public static event EventHandler<EventArgsKeyboardStateChanged> KeyboardChanged = delegate { };
+ public static event EventHandler<EventArgsKeyPressed> KeyPressed = delegate { };
+ public static event EventHandler<EventArgsMouseStateChanged> MouseChanged = delegate { };
+
+ public static void InvokeKeyboardChanged(KeyboardState priorState, KeyboardState newState)
+ {
+ KeyboardChanged.Invoke(null, new EventArgsKeyboardStateChanged(priorState, newState));
+ }
+
+ public static void InvokeMouseChanged(MouseState priorState, MouseState newState)
+ {
+ MouseChanged.Invoke(null, new EventArgsMouseStateChanged(priorState, newState));
+ }
+
+ public static void InvokeKeyPressed(Keys key)
+ {
+ KeyPressed.Invoke(null, new EventArgsKeyPressed(key));
+ }
+ }
+}