From d40a7e26cd8550f969d15710d0b067625b8d4ed4 Mon Sep 17 00:00:00 2001 From: Nielk1 Date: Fri, 16 Feb 2018 17:44:48 -0600 Subject: [PATCH] Switched to customized HidLibrary to resolve delay Dependency: https://github.com/Nielk1/HidLibrary Adjusted default themes to use 30 length touch trail instead of 60 length. The more responsive rendering made the tail far too long. --- VSCView.sln | 6 ++++++ VSCView/Properties/AssemblyInfo.cs | 4 ++-- VSCView/SteamController.cs | 26 ++++++++++++++------------ VSCView/VSCView.csproj | 9 ++++++--- VSCView/packages.config | 1 - VSCView/themes/default/all.json | 4 ++-- VSCView/themes/default/nogyro.json | 4 ++-- 7 files changed, 32 insertions(+), 22 deletions(-) diff --git a/VSCView.sln b/VSCView.sln index 859fad9..fc4815d 100644 --- a/VSCView.sln +++ b/VSCView.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.26730.16 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSCView", "VSCView\VSCView.csproj", "{E513702D-EF79-4766-AD9D-C2382BD0CEAD}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HidLibrary", "..\HidLibrary\src\HidLibrary\HidLibrary.csproj", "{9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {E513702D-EF79-4766-AD9D-C2382BD0CEAD}.Debug|Any CPU.Build.0 = Debug|Any CPU {E513702D-EF79-4766-AD9D-C2382BD0CEAD}.Release|Any CPU.ActiveCfg = Release|Any CPU {E513702D-EF79-4766-AD9D-C2382BD0CEAD}.Release|Any CPU.Build.0 = Release|Any CPU + {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/VSCView/Properties/AssemblyInfo.cs b/VSCView/Properties/AssemblyInfo.cs index 9091b58..a4a3cbb 100644 --- a/VSCView/Properties/AssemblyInfo.cs +++ b/VSCView/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.0.3")] -[assembly: AssemblyFileVersion("0.2.0.3")] +[assembly: AssemblyVersion("0.3.0.4")] +[assembly: AssemblyFileVersion("0.3.0.4")] diff --git a/VSCView/SteamController.cs b/VSCView/SteamController.cs index f95062b..14453fd 100644 --- a/VSCView/SteamController.cs +++ b/VSCView/SteamController.cs @@ -15,7 +15,7 @@ public class SteamController private const int ProductIdWireless = 0x1142; // 4418; private const int ProductIdWired = 0x1102; // 4354 - private bool _attached = false; + //private bool _attached = false; private HidDevice _device; public enum VSCEventType @@ -169,24 +169,26 @@ public void Initalize() //_device.OpenDevice(); - _device.Inserted += DeviceAttachedHandler; - _device.Removed += DeviceRemovedHandler; + //_device.Inserted += DeviceAttachedHandler; + //_device.Removed += DeviceRemovedHandler; - _device.MonitorDeviceEvents = true; - - _device.ReadReport(OnReport); + //_device.MonitorDeviceEvents = true; Initalized = true; + + //_attached = _device.IsConnected; + + _device.ReadReport(OnReport); } public void DeInitalize() { if (!Initalized) return; - _device.Inserted -= DeviceAttachedHandler; - _device.Removed -= DeviceRemovedHandler; + //_device.Inserted -= DeviceAttachedHandler; + //_device.Removed -= DeviceRemovedHandler; - _device.MonitorDeviceEvents = false; + //_device.MonitorDeviceEvents = false; Initalized = false; } @@ -269,7 +271,7 @@ private void OnReport(HidReport report) { //SteamControllerState OldState = GetState(); - if (_attached == false) { return; } + //if (_attached == false) { return; } byte Unknown1 = report.Data[0]; // always 0x01? byte Unknown2 = report.Data[1]; // always 0x00? @@ -419,7 +421,7 @@ private void OnReport(HidReport report) } } - private void DeviceAttachedHandler() + /*private void DeviceAttachedHandler() { lock (controllerStateLock) { @@ -436,6 +438,6 @@ private void DeviceRemovedHandler() _attached = false; Console.WriteLine("VSC Address Removed"); } - } + }*/ } } diff --git a/VSCView/VSCView.csproj b/VSCView/VSCView.csproj index 04da5d8..1d081a8 100644 --- a/VSCView/VSCView.csproj +++ b/VSCView/VSCView.csproj @@ -34,9 +34,6 @@ 4 - - ..\packages\hidlibrary.3.2.46.0\lib\HidLibrary.dll - ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll @@ -177,5 +174,11 @@ PreserveNewest + + + {9e8f1d50-74ea-4c60-bd5c-ab2c5b53bc66} + HidLibrary + + \ No newline at end of file diff --git a/VSCView/packages.config b/VSCView/packages.config index 2726fbe..542d4d9 100644 --- a/VSCView/packages.config +++ b/VSCView/packages.config @@ -1,5 +1,4 @@  - \ No newline at end of file diff --git a/VSCView/themes/default/all.json b/VSCView/themes/default/all.json index 5df4044..286eaa2 100644 --- a/VSCView/themes/default/all.json +++ b/VSCView/themes/default/all.json @@ -73,7 +73,7 @@ "scaleFactorX": 0.0022, "scaleFactorY": 0.0022, "image":"padheat.png", - "length":60, + "length":30, "width":36, "height":36, "children": [ @@ -99,7 +99,7 @@ "scaleFactorX": 0.0022, "scaleFactorY": 0.0022, "image":"padheat.png", - "length":60, + "length":30, "width":36, "height":36, "children": [ diff --git a/VSCView/themes/default/nogyro.json b/VSCView/themes/default/nogyro.json index 7a1c909..3d8be50 100644 --- a/VSCView/themes/default/nogyro.json +++ b/VSCView/themes/default/nogyro.json @@ -73,7 +73,7 @@ "scaleFactorX": 0.0022, "scaleFactorY": 0.0022, "image":"padheat.png", - "length":60, + "length":30, "width":36, "height":36, "children": [ @@ -99,7 +99,7 @@ "scaleFactorX": 0.0022, "scaleFactorY": 0.0022, "image":"padheat.png", - "length":60, + "length":30, "width":36, "height":36, "children": [