Skip to content

Commit

Permalink
Switched to customized HidLibrary to resolve delay
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Nielk1 committed Feb 16, 2018
1 parent 1d3574d commit d40a7e2
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 22 deletions.
6 changes: 6 additions & 0 deletions VSCView.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions VSCView/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
26 changes: 14 additions & 12 deletions VSCView/SteamController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -419,7 +421,7 @@ private void OnReport(HidReport report)
}
}

private void DeviceAttachedHandler()
/*private void DeviceAttachedHandler()
{
lock (controllerStateLock)
{
Expand All @@ -436,6 +438,6 @@ private void DeviceRemovedHandler()
_attached = false;
Console.WriteLine("VSC Address Removed");
}
}
}*/
}
}
9 changes: 6 additions & 3 deletions VSCView/VSCView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="HidLibrary, Version=3.2.46.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\hidlibrary.3.2.46.0\lib\HidLibrary.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -177,5 +174,11 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\HidLibrary\src\HidLibrary\HidLibrary.csproj">
<Project>{9e8f1d50-74ea-4c60-bd5c-ab2c5b53bc66}</Project>
<Name>HidLibrary</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
1 change: 0 additions & 1 deletion VSCView/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="hidlibrary" version="3.2.46.0" targetFramework="net462" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net462" />
</packages>
4 changes: 2 additions & 2 deletions VSCView/themes/default/all.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"scaleFactorX": 0.0022,
"scaleFactorY": 0.0022,
"image":"padheat.png",
"length":60,
"length":30,
"width":36,
"height":36,
"children": [
Expand All @@ -99,7 +99,7 @@
"scaleFactorX": 0.0022,
"scaleFactorY": 0.0022,
"image":"padheat.png",
"length":60,
"length":30,
"width":36,
"height":36,
"children": [
Expand Down
4 changes: 2 additions & 2 deletions VSCView/themes/default/nogyro.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"scaleFactorX": 0.0022,
"scaleFactorY": 0.0022,
"image":"padheat.png",
"length":60,
"length":30,
"width":36,
"height":36,
"children": [
Expand All @@ -99,7 +99,7 @@
"scaleFactorX": 0.0022,
"scaleFactorY": 0.0022,
"image":"padheat.png",
"length":60,
"length":30,
"width":36,
"height":36,
"children": [
Expand Down

0 comments on commit d40a7e2

Please sign in to comment.