diff options
| author | Tomáš Pazdiora <[email protected]> | 2021-01-07 23:21:33 +0100 |
|---|---|---|
| committer | Tomáš Pazdiora <[email protected]> | 2021-01-07 23:21:33 +0100 |
| commit | 215a21f9b62aa50d9ca4037ca0a22f5b0920f373 (patch) | |
| tree | 3f0cbca12e4575cc325c86996d952d01829b2acd /devicelist/Program.cs | |
| parent | update devicelist app (diff) | |
| download | rawaccel-215a21f9b62aa50d9ca4037ca0a22f5b0920f373.tar.xz rawaccel-215a21f9b62aa50d9ca4037ca0a22f5b0920f373.zip | |
rough GUI integration of "Device Hardware ID"
Diffstat (limited to 'devicelist/Program.cs')
| -rw-r--r-- | devicelist/Program.cs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/devicelist/Program.cs b/devicelist/Program.cs deleted file mode 100644 index 9323fd4..0000000 --- a/devicelist/Program.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text; -using System.Management; -using System.Windows.Forms; - -namespace devicelist -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine("To use Raw Accel driver for a specific device, " - + "replace '\"Device Hardware ID\": null' in 'settings.json' by following:"); - Console.WriteLine(""); - - ManagementObjectSearcher searcher = new ManagementObjectSearcher(new SelectQuery("Win32_PnPEntity")); - - foreach (ManagementObject obj in searcher.Get()) - { - bool is_mouse = obj["PNPClass"] != null && obj["PNPClass"].ToString() == "Mouse"; // == "HIDClass" ??? - - if (is_mouse && obj["HardwareID"] != null) { - String[] hwidArray = (String[])(obj["HardwareID"]); - if (hwidArray.Length > 0) { - String hwid = hwidArray[0].ToString().Replace(@"\", @"\\"); - String name = obj["Name"].ToString(); - Console.WriteLine(name + ":"); - Console.WriteLine("\"Device Hardware ID\": \"" + hwid + "\""); - Console.WriteLine(""); - } - } - } - - Console.ReadKey(); - } - } -} |