diff --git a/AquaMai.csproj b/AquaMai.csproj
index b3b0fbbc..8f982aa2 100644
--- a/AquaMai.csproj
+++ b/AquaMai.csproj
@@ -303,6 +303,7 @@
+
diff --git a/AquaMai.toml b/AquaMai.toml
index b81e560e..cc213ef9 100644
--- a/AquaMai.toml
+++ b/AquaMai.toml
@@ -44,6 +44,8 @@ ExecOnEntry=""
ExtendTimer=true
# Save immediate after playing a song
ImmediateSave=true
+# Prevent accidental touch of the Test button
+TestProof=false
[Performance]
# Disable some useless delays to speed up the game boot process
diff --git a/Config.cs b/Config.cs
index 8b2be814..3a4c9605 100644
--- a/Config.cs
+++ b/Config.cs
@@ -31,6 +31,7 @@ namespace AquaMai
public bool SkipEventInfo { get; set; }
public bool ImmediateSave { get; set; }
public bool LoadLocalBga { get; set; }
+ public bool TestProof { get; set; }
public string CustomVersionString { get; set; }
public string ExecOnIdle { get; set; }
public string ExecOnEntry { get; set; }
diff --git a/UX/TestProof.cs b/UX/TestProof.cs
new file mode 100644
index 00000000..4ca24487
--- /dev/null
+++ b/UX/TestProof.cs
@@ -0,0 +1,47 @@
+using System.Diagnostics;
+using System.Linq;
+using HarmonyLib;
+using Manager;
+using MelonLoader;
+
+namespace AquaMai.UX;
+
+public class TestProof
+{
+ private static int _keyPressFrames;
+
+ [HarmonyPrefix]
+ [HarmonyPatch(typeof(InputManager), "GetSystemInputDown")]
+ public static bool GetSystemInputDown(ref bool __result, InputManager.SystemButtonSetting button, bool[] ___SystemButtonDown)
+ {
+ __result = ___SystemButtonDown[(int)button];
+ if (button != InputManager.SystemButtonSetting.ButtonTest)
+ return false;
+ if (!InputManager.GetSystemInputPush(button))
+ {
+ _keyPressFrames = 0;
+ return false;
+ }
+
+ var stackTrace = new StackTrace(); // get call stack
+ var stackFrames = stackTrace.GetFrames(); // get method calls (frames)
+
+ if (stackFrames.Any(it => it.GetMethod().Name == "DMD"))
+ {
+ __result = false;
+ if (InputManager.GetSystemInputPush(button))
+ {
+ _keyPressFrames++;
+ }
+
+ if (_keyPressFrames == 60)
+ {
+ __result = true;
+ }
+
+ MelonLogger.Msg(_keyPressFrames);
+ }
+
+ return false;
+ }
+}