diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-19 21:47:31 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-19 21:47:31 -0500 |
commit | 7e90b1c60aa12d8c552a56738711500cab783be0 (patch) | |
tree | 328a54b893c8113329bfffee65b37a15238c0ef5 /src | |
parent | 7e280a066db92c74e957e2a694c922d4c3eae017 (diff) | |
download | SMAPI-7e90b1c60aa12d8c552a56738711500cab783be0.tar.gz SMAPI-7e90b1c60aa12d8c552a56738711500cab783be0.tar.bz2 SMAPI-7e90b1c60aa12d8c552a56738711500cab783be0.zip |
add shortcut method to create a keybind list for a single default keybind (#744)
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI/Utilities/KeybindList.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/SMAPI/Utilities/KeybindList.cs b/src/SMAPI/Utilities/KeybindList.cs index f6933af3..4ae66ab7 100644 --- a/src/SMAPI/Utilities/KeybindList.cs +++ b/src/SMAPI/Utilities/KeybindList.cs @@ -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() |