From 6bd8325bde8dd35e00d5a8f5f84b24a41d4415f6 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 1 Jul 2026 13:24:40 -0500 Subject: [PATCH] small fixes + new util --- CalamityKeybinds.cs | 11 +++++++++++ Utilities/MiscUtils.cs | 2 ++ 2 files changed, 13 insertions(+) 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