diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index a12d354a07..7e5079007d 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -1,7 +1,9 @@ using System; using System.Linq; using CalamityMod.Systems.Collections; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.GameInput; using Terraria.ModLoader; namespace CalamityMod @@ -212,5 +214,14 @@ namespace CalamityMod return CalamityKeybinds.AccessoryKeybinds[keybindToUse]; } + + public static bool HasBoundDynamicHotkey(this Item item) + { + var h = item.GetDynamicModHotkey(); + if (h == null) return false; + if (h?.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count() == 0) + return false; + return true; + } } } diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index d1eab75448..40cebbd5b7 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -314,6 +314,8 @@ namespace CalamityMod try { + if (mode == InputMode.Mouse) + mode = InputMode.Keyboard; return keybind.GetAssignedKeys(mode); } catch