Files
poli0981andClaude Opus 5.5 7f6158e7b7 build: v2 build infrastructure
- Directory.Build.props: single product version (2.0.0), C# latest, nullable,
  SDK analyzers at latest-recommended with code style enforced in builds,
  documentation file for IDE0005, satellite languages limited to the five
  supported ones; CI builds keep treating warnings as errors.
- Central package management with transitive pinning (SkiaSharp 3.119.4),
  nuget.config with package source mapping (nuget.org only).
- .editorconfig: unused usings/members/parameters/assignments are warnings
  (errors in CI); CA1812/CA1848 off for DI/XAML-created types.
- .gitattributes for line endings; .gitignore narrowed for .claude/ and
  extended with build outputs.
- New test projects (xUnit v3 on Microsoft.Testing.Platform) and a test-only
  ClickTarget app that logs the input it receives, for end-to-end checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 19:28:21 +07:00

41 lines
1.5 KiB
C#

namespace AutoClick.ClickTarget;
/// <summary>
/// Test target for AutoClick end-to-end checks. It logs every mouse button and keyboard
/// message it receives (client coordinates, virtual-key and scan codes).
///
/// Switches:
/// --dpi unaware|system|pmv2 DPI awareness of this process (default: pmv2), to check
/// coordinate mapping for games that are not DPI aware.
/// --log &lt;path&gt; append one tab-separated line per received message.
/// --title &lt;text&gt; window title (default: "AutoClick ClickTarget").
/// </summary>
internal static class Program
{
[STAThread]
private static void Main(string[] args)
{
var dpi = GetArg(args, "--dpi") ?? "pmv2";
var mode = dpi.ToLowerInvariant() switch
{
"unaware" => HighDpiMode.DpiUnaware,
"system" => HighDpiMode.SystemAware,
_ => HighDpiMode.PerMonitorV2,
};
Application.SetHighDpiMode(mode);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var title = GetArg(args, "--title") ?? "AutoClick ClickTarget";
using var form = new TargetForm($"{title} [{mode}]", GetArg(args, "--log"));
Application.Run(form);
}
private static string? GetArg(string[] args, string name)
{
var index = Array.FindIndex(args, a => string.Equals(a, name, StringComparison.OrdinalIgnoreCase));
return index >= 0 && index + 1 < args.Length ? args[index + 1] : null;
}
}