-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (27 loc) · 783 Bytes
/
Program.cs
File metadata and controls
36 lines (27 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using HID2Input.Config;
using HID2Input.HID;
using HID2Input.Logging;
string configPath = "HIDConfig.yaml";
if (args.Length > 1)
{
Console.WriteLine("Usage: HID2Input.exe HIDConfig.yaml");
Environment.Exit(0);
return;
}
if (args.Length == 1)
configPath = args[0];
if (!File.Exists(configPath))
{
Console.WriteLine($"Config not found:\n{configPath}");
Console.WriteLine($"Visit Github Wiki to learn how to use it.");
Environment.Exit(0);
return;
}
var config = ConfigLoader.Load(configPath);
Logger.Initialize(config.Logging);
Logger.Info($"Config Loaded: {configPath}");
Logger.Info("Starting HID manager...");
var manager = new HidDeviceManager(config);
manager.Start();
Logger.Info("Running... Press ENTER to exit.");
Console.ReadLine();