From 7e90b1c60aa12d8c552a56738711500cab783be0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 19 Jan 2021 21:47:31 -0500 Subject: add shortcut method to create a keybind list for a single default keybind (#744) --- src/SMAPI/Utilities/KeybindList.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/SMAPI/Utilities') 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 } } + /// Get a keybind list for a single keybind. + /// The buttons that must be down to activate the keybind. + public static KeybindList ForSingle(params SButton[] buttons) + { + return new KeybindList( + new Keybind(buttons) + ); + } + /// Get the overall keybind list state relative to the previous tick. /// States are transitive across keybind. For example, if one keybind is 'released' and another is 'pressed', the state of the keybind list is 'held'. public SButtonState GetState() -- cgit