summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Events/Controls.cs
diff options
context:
space:
mode:
authorClxS <slxxls92@gmail.com>2016-03-07 13:49:45 +0000
committerClxS <slxxls92@gmail.com>2016-03-07 13:49:45 +0000
commit71bcfc11dea8c189152a9aa2534c87e1b1486018 (patch)
treefbfe5327353e0102dc2fc3b7bb6020e1010aee16 /StardewModdingAPI/Events/Controls.cs
parent49090c98fcdc11ca536de42875f50b763e83ce63 (diff)
downloadSMAPI-71bcfc11dea8c189152a9aa2534c87e1b1486018.tar.gz
SMAPI-71bcfc11dea8c189152a9aa2534c87e1b1486018.tar.bz2
SMAPI-71bcfc11dea8c189152a9aa2534c87e1b1486018.zip
Partially completed events for gamepad input
Diffstat (limited to 'StardewModdingAPI/Events/Controls.cs')
-rw-r--r--StardewModdingAPI/Events/Controls.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/StardewModdingAPI/Events/Controls.cs b/StardewModdingAPI/Events/Controls.cs
index 8cf0f431..fa344bab 100644
--- a/StardewModdingAPI/Events/Controls.cs
+++ b/StardewModdingAPI/Events/Controls.cs
@@ -1,4 +1,5 @@
-using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Input;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -13,6 +14,8 @@ namespace StardewModdingAPI.Events
public static event EventHandler<EventArgsKeyPressed> KeyPressed = delegate { };
public static event EventHandler<EventArgsKeyPressed> KeyReleased = delegate { };
public static event EventHandler<EventArgsMouseStateChanged> MouseChanged = delegate { };
+ public static event EventHandler<EventArgsControllerButtonPressed> ControllerButtonPressed = delegate { };
+ public static event EventHandler<EventArgsControllerButtonReleased> ControllerButtonReleased = delegate { };
public static void InvokeKeyboardChanged(KeyboardState priorState, KeyboardState newState)
{
@@ -33,5 +36,15 @@ namespace StardewModdingAPI.Events
{
KeyReleased.Invoke(null, new EventArgsKeyPressed(key));
}
+
+ public static void InvokeButtonPressed(PlayerIndex playerIndex, Buttons buttons)
+ {
+ ControllerButtonPressed.Invoke(null, new EventArgsControllerButtonPressed(playerIndex, buttons));
+ }
+
+ public static void InvokeButtonReleased(PlayerIndex playerIndex, Buttons buttons)
+ {
+ ControllerButtonReleased.Invoke(null, new EventArgsControllerButtonReleased(playerIndex, buttons));
+ }
}
}