add shortcut method to create a keybind list for a single default keybind (#744)

This commit is contained in:
Jesse Plamondon-Willard 2021-01-19 21:47:31 -05:00
parent 7e280a066d
commit 7e90b1c60a
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 9 additions and 0 deletions

View File

@ -83,6 +83,15 @@ namespace StardewModdingAPI.Utilities
}
}
/// <summary>Get a keybind list for a single keybind.</summary>
/// <param name="buttons">The buttons that must be down to activate the keybind.</param>
public static KeybindList ForSingle(params SButton[] buttons)
{
return new KeybindList(
new Keybind(buttons)
);
}
/// <summary>Get the overall keybind list state relative to the previous tick.</summary>
/// <remarks>States are transitive across keybind. For example, if one keybind is 'released' and another is 'pressed', the state of the keybind list is 'held'.</remarks>
public SButtonState GetState()