diff options
author | James Finlay <jtfinlay@ualberta.ca> | 2016-03-06 12:25:14 -0800 |
---|---|---|
committer | James Finlay <jtfinlay@ualberta.ca> | 2016-03-06 12:25:14 -0800 |
commit | ac8b73898597a8999e4e03445306d163d4fbcd19 (patch) | |
tree | 939775570f25df6bcef362ff7792cee7485e1c5e /StardewModdingAPI/Inheritance/SGame.cs | |
parent | 65c7c9b733bf6c6122ea591bba789a914dbd404d (diff) | |
parent | bfe6537f84fe780197c4554f360f19c3f9f12371 (diff) | |
download | SMAPI-ac8b73898597a8999e4e03445306d163d4fbcd19.tar.gz SMAPI-ac8b73898597a8999e4e03445306d163d4fbcd19.tar.bz2 SMAPI-ac8b73898597a8999e4e03445306d163d4fbcd19.zip |
Merge
Diffstat (limited to 'StardewModdingAPI/Inheritance/SGame.cs')
-rw-r--r-- | StardewModdingAPI/Inheritance/SGame.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/StardewModdingAPI/Inheritance/SGame.cs b/StardewModdingAPI/Inheritance/SGame.cs index c7b07c43..120f4a6e 100644 --- a/StardewModdingAPI/Inheritance/SGame.cs +++ b/StardewModdingAPI/Inheritance/SGame.cs @@ -43,6 +43,10 @@ namespace StardewModdingAPI.Inheritance {
get { return CurrentlyPressedKeys.Where(x => !PreviouslyPressedKeys.Contains(x)).ToArray(); }
}
+ public Keys[] FrameReleasedKeys
+ {
+ get { return PreviouslyPressedKeys.Where(x => !CurrentlyPressedKeys.Contains(x)).ToArray(); }
+ }
public int PreviousGameLocations { get; private set; }
public int PreviousLocationObjects { get; private set; }
@@ -233,11 +237,15 @@ namespace StardewModdingAPI.Inheritance {
KStateNow = Keyboard.GetState();
CurrentlyPressedKeys = KStateNow.GetPressedKeys();
+
MStateNow = Mouse.GetState();
foreach (Keys k in FramePressedKeys)
Events.ControlEvents.InvokeKeyPressed(k);
-
+
+ foreach (Keys k in FrameReleasedKeys)
+ Events.ControlEvents.InvokeKeyReleased(k);
+
if (KStateNow != KStatePrior)
{
Events.ControlEvents.InvokeKeyboardChanged(KStatePrior, KStateNow);
|