diff options
| author | Tomáš Pazdiora <[email protected]> | 2021-01-07 20:37:23 +0100 |
|---|---|---|
| committer | Tomáš Pazdiora <[email protected]> | 2021-01-07 20:37:23 +0100 |
| commit | 7c4fd76da65b5545d30fbe123274d348f86e24b8 (patch) | |
| tree | 8f9aefce33c2e0da4732278b6a43b490f949a00f /devicelist | |
| parent | update signed/driver (diff) | |
| download | rawaccel-7c4fd76da65b5545d30fbe123274d348f86e24b8.tar.xz rawaccel-7c4fd76da65b5545d30fbe123274d348f86e24b8.zip | |
update devicelist app
Diffstat (limited to 'devicelist')
| -rw-r--r-- | devicelist/Program.cs | 20 | ||||
| -rw-r--r-- | devicelist/devicelist.csproj | 2 |
2 files changed, 16 insertions, 6 deletions
diff --git a/devicelist/Program.cs b/devicelist/Program.cs index 6ac08f6..9323fd4 100644 --- a/devicelist/Program.cs +++ b/devicelist/Program.cs @@ -9,19 +9,29 @@ namespace devicelist { 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()) { - if (obj["PNPClass"].ToString() == "Mouse" && obj["HardwareID"] != null) { + bool is_mouse = obj["PNPClass"] != null && obj["PNPClass"].ToString() == "Mouse"; // == "HIDClass" ??? + + if (is_mouse && obj["HardwareID"] != null) { String[] hwidArray = (String[])(obj["HardwareID"]); - String hwid = hwidArray[0].ToString().Replace(@"\", @"\\"); - String caption = "(" + obj["Name"].ToString() + ") Device Hardware ID:"; - if (MessageBox.Show(hwid, caption, MessageBoxButtons.OKCancel) == DialogResult.Cancel) { - break; + 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(); } } } diff --git a/devicelist/devicelist.csproj b/devicelist/devicelist.csproj index 378c518..154d0d0 100644 --- a/devicelist/devicelist.csproj +++ b/devicelist/devicelist.csproj @@ -5,7 +5,7 @@ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{3666B731-7406-41B1-BCFC-C65073FD09A1}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Exe</OutputType> <RootNamespace>devicelist</RootNamespace> <AssemblyName>devicelist</AssemblyName> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> |