Update 0.01 G
This commit is contained in:
+21
-3
@@ -7,32 +7,45 @@ namespace Lua
|
||||
{
|
||||
static class Utils
|
||||
{
|
||||
// AA0091
|
||||
public static readonly SpeechSynthesizer Tts = new SpeechSynthesizer();
|
||||
// AA0092
|
||||
private static readonly object TtsLock = new object();
|
||||
|
||||
// AA0093
|
||||
[DllImport("user32.dll")]
|
||||
public static extern short GetAsyncKeyState(int vKey);
|
||||
|
||||
// AA0094
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
|
||||
public static extern short GetKeyState(int keyCode);
|
||||
|
||||
// AA0095
|
||||
[DllImport("user32.dll")]
|
||||
public static extern void mouse_event(uint dwFlags, int dx, int dy, uint dwData, UIntPtr dwExtraInfo);
|
||||
|
||||
// AA0096
|
||||
public const uint MOUSEEVENTF_MOVE = 0x0001;
|
||||
|
||||
// AA0097
|
||||
private const int VK_CAPITAL = 0x14;
|
||||
// AA0098
|
||||
private static bool _previousCapsState;
|
||||
|
||||
// AA0099
|
||||
public static void InitializeCapsState()
|
||||
{
|
||||
_previousCapsState = IsCapsLockOn();
|
||||
}
|
||||
|
||||
// AA0100
|
||||
public static bool IsPressed(int vKey) => (GetAsyncKeyState(vKey) & 0x8000) != 0;
|
||||
// AA0101
|
||||
public static bool IsCapsLockOn() => (GetKeyState(VK_CAPITAL) & 0x0001) != 0;
|
||||
// AA0102
|
||||
public static void MoveMouse(int dx, int dy) => mouse_event(MOUSEEVENTF_MOVE, dx, dy, 0, UIntPtr.Zero);
|
||||
|
||||
// AA0103
|
||||
public static void SafeSpeak(string text)
|
||||
{
|
||||
if (!ConfigLoader.ttsEnabled) return;
|
||||
@@ -44,10 +57,11 @@ namespace Lua
|
||||
Tts.SpeakAsyncCancelAll();
|
||||
Tts.SpeakAsync(text);
|
||||
}
|
||||
catch { /* Ignore TTS errors */ }
|
||||
catch { /* AA0104 */ }
|
||||
}
|
||||
}
|
||||
|
||||
// AA0105
|
||||
public static void ShowCapsLockStatus()
|
||||
{
|
||||
Console.WriteLine(IsCapsLockOn()
|
||||
@@ -55,6 +69,7 @@ namespace Lua
|
||||
: $"✅ Recoil Control: ON (CapsLock OFF) | Current Set: {OperatorSets.CurrentSet}");
|
||||
}
|
||||
|
||||
// AA0106
|
||||
public static void CheckCapsLockChange()
|
||||
{
|
||||
bool caps = IsCapsLockOn();
|
||||
@@ -65,12 +80,14 @@ namespace Lua
|
||||
}
|
||||
}
|
||||
|
||||
// AA0107
|
||||
public static void DisplayCurrentOperator(string action)
|
||||
{
|
||||
Console.WriteLine($"🎮 {action} | Current Operator: {OperatorSets.CurrentSet}");
|
||||
SafeSpeak(OperatorSets.CurrentSet);
|
||||
}
|
||||
|
||||
// AA0108
|
||||
public static string ModeHeader()
|
||||
{
|
||||
return ConfigLoader.betaTest
|
||||
@@ -78,12 +95,13 @@ namespace Lua
|
||||
: $"🚀 Standard Mode Enabled | Current Set: {OperatorSets.CurrentSet}";
|
||||
}
|
||||
|
||||
// AA0109
|
||||
public static void AutoClearIfNearBottom()
|
||||
{
|
||||
try
|
||||
{
|
||||
int current = Console.CursorTop;
|
||||
int limit = Console.WindowHeight - 2; // Keep 2-row buffer
|
||||
int limit = Console.WindowHeight - 2;
|
||||
|
||||
if (current >= limit)
|
||||
{
|
||||
@@ -94,7 +112,7 @@ namespace Lua
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore if console unavailable
|
||||
// AA0110
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user