summaryrefslogtreecommitdiff
path: root/src/SMAPI/Utilities/KeybindList.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-03-21 15:18:30 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-03-21 15:18:30 -0400
commitd61bb78b2add425eb385931d36ab4b54e115d870 (patch)
tree61367609c42d9f8a2c3b58306fdcd11012b10fcb /src/SMAPI/Utilities/KeybindList.cs
parentc070e34c2f18a18d03dbe9f86f5d17491215b6e2 (diff)
downloadSMAPI-d61bb78b2add425eb385931d36ab4b54e115d870.tar.gz
SMAPI-d61bb78b2add425eb385931d36ab4b54e115d870.tar.bz2
SMAPI-d61bb78b2add425eb385931d36ab4b54e115d870.zip
simplify creating keybind list for single key
Diffstat (limited to 'src/SMAPI/Utilities/KeybindList.cs')
-rw-r--r--src/SMAPI/Utilities/KeybindList.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/SMAPI/Utilities/KeybindList.cs b/src/SMAPI/Utilities/KeybindList.cs
index 1845285a..28cae240 100644
--- a/src/SMAPI/Utilities/KeybindList.cs
+++ b/src/SMAPI/Utilities/KeybindList.cs
@@ -30,6 +30,11 @@ namespace StardewModdingAPI.Utilities
this.IsBound = this.Keybinds.Any();
}
+ /// <summary>Construct an instance.</summary>
+ /// <param name="singleKey">A single-key binding.</param>
+ public KeybindList(SButton singleKey)
+ : this(new Keybind(singleKey)) { }
+
/// <summary>Parse a keybind list from a string, and throw an exception if it's not valid.</summary>
/// <param name="input">The keybind string. See remarks on <see cref="ToString"/> for format details.</param>
/// <exception cref="FormatException">The <paramref name="input"/> format is invalid.</exception>