using System; using Dalamud.Bindings.ImGui; namespace Questionable.Windows.Utils; internal static class ThrottledClipboard { private const long RefreshIntervalMs = 500L; private static long _nextReadAtMs; private static string _cachedText = string.Empty; public static string GetText() { long tickCount = Environment.TickCount64; if (tickCount >= _nextReadAtMs) { _nextReadAtMs = tickCount + 500; try { _cachedText = ImGui.GetClipboardText()?.Trim() ?? string.Empty; } catch (Exception) { _cachedText = string.Empty; } } return _cachedText; } }