Dalamud/Dalamud/Interface/Internal/Windows/SelfTest/Steps/KeyStateSelfTestStep.cs
2025-08-04 23:40:34 +02:00

38 lines
860 B
C#

using Dalamud.Bindings.ImGui;
using Dalamud.Game.ClientState.Keys;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;
/// <summary>
/// Test setup for the Key State.
/// </summary>
internal class KeyStateSelfTestStep : ISelfTestStep
{
/// <inheritdoc/>
public string Name => "Test KeyState";
/// <inheritdoc/>
public SelfTestStepResult RunStep()
{
var keyState = Service<KeyState>.Get();
ImGui.Text("Hold down D,A,L,M,U"u8);
if (keyState[VirtualKey.D]
&& keyState[VirtualKey.A]
&& keyState[VirtualKey.L]
&& keyState[VirtualKey.M]
&& keyState[VirtualKey.U])
{
return SelfTestStepResult.Pass;
}
return SelfTestStepResult.Waiting;
}
/// <inheritdoc/>
public void CleanUp()
{
// ignored
}
}