From 0c3b87b4cb08188fb3a38e22fe904d274c5e9b5e Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:09:55 +0100 Subject: [PATCH] Input listener for S17 https://github.com/seerge/g-helper/issues/2247 --- app/AppConfig.cs | 5 +++++ app/USB/AsusHid.cs | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/app/AppConfig.cs b/app/AppConfig.cs index ffe9e047..57f9961f 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -454,6 +454,11 @@ public static class AppConfig return ContainsModel("Z13"); } + public static bool IsS17() + { + return ContainsModel("S17"); + } + public static bool HasTabletMode() { return ContainsModel("X16") || ContainsModel("X13"); diff --git a/app/USB/AsusHid.cs b/app/USB/AsusHid.cs index bcbc96d8..8116865e 100644 --- a/app/USB/AsusHid.cs +++ b/app/USB/AsusHid.cs @@ -47,6 +47,15 @@ public static class AsusHid if (z13 is not null) return z13.Open(); } + if (AppConfig.IsS17()) + { + var s17 = devices.Where(device => device.ProductID == 0x18c6).FirstOrDefault(); + if (s17 is not null) return s17.Open(); + } + + foreach (var device in devices) + Logger.WriteLine($"Input available: {device.DevicePath} {device.ProductID.ToString("X")} {device.GetMaxFeatureReportLength()}"); + return devices.FirstOrDefault()?.Open(); } catch (Exception ex)