├── OculusTouchCalibration ├── packages.config ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Program.cs ├── OculusTouchCalibration.sln ├── DecimalJsonConverter.cs ├── CalibrationData.cs ├── app.manifest ├── OculusTouchCalibration.csproj ├── Form1.resx ├── Form1.cs └── Form1.Designer.cs ├── README.md └── .gitignore /OculusTouchCalibration/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /OculusTouchCalibration/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /OculusTouchCalibration/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OculusTouchCalibration/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace OculusTouchCalibration 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /OculusTouchCalibration/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OculusTouchCalibration.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /OculusTouchCalibration/OculusTouchCalibration.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2027 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OculusTouchCalibration", "OculusTouchCalibration.csproj", "{AEB50259-EBCD-4340-A736-C4FCA708EBE0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {AEB50259-EBCD-4340-A736-C4FCA708EBE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {AEB50259-EBCD-4340-A736-C4FCA708EBE0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {AEB50259-EBCD-4340-A736-C4FCA708EBE0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {AEB50259-EBCD-4340-A736-C4FCA708EBE0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {EB9CB4DD-2A7D-4A17-BEA0-2881A05C1C6D} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /OculusTouchCalibration/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OculusTouchCalibration")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("OculusTouchCalibration")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("aeb50259-ebcd-4340-a736-c4fca708ebe0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /OculusTouchCalibration/DecimalJsonConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace OculusTouchCalibration 5 | { 6 | class DecimalJsonConverter : JsonConverter 7 | { 8 | public DecimalJsonConverter() 9 | { 10 | } 11 | 12 | public override bool CanRead 13 | { 14 | get 15 | { 16 | return false; 17 | } 18 | } 19 | 20 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 21 | { 22 | throw new NotImplementedException("Unnecessary because CanRead is false. The type will skip the converter."); 23 | } 24 | 25 | public override bool CanConvert(Type objectType) 26 | { 27 | return (objectType == typeof(decimal) || objectType == typeof(float) || objectType == typeof(double)); 28 | } 29 | 30 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 31 | { 32 | if (DecimalJsonConverter.IsWholeValue(value)) 33 | { 34 | writer.WriteRawValue(JsonConvert.ToString(Convert.ToInt64(value))); 35 | } 36 | else 37 | { 38 | writer.WriteRawValue(JsonConvert.ToString(value).ToLowerInvariant()); 39 | } 40 | } 41 | 42 | private static bool IsWholeValue(object value) 43 | { 44 | if (value is decimal) 45 | { 46 | decimal decimalValue = (decimal)value; 47 | int precision = (Decimal.GetBits(decimalValue)[3] >> 16) & 0x000000FF; 48 | return precision == 0; 49 | } 50 | else if (value is float || value is double) 51 | { 52 | double doubleValue = Convert.ToDouble(value); 53 | return doubleValue == Math.Truncate(doubleValue); 54 | } 55 | 56 | return false; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Oculus Touch Deadzone Calibration Tool 2 | 3 | This tool will allow you to adjust Oculus Touch thumbsticks deadzones. It may be useful if thumbstick started activating at times when it should not. 4 | Compatible only with original Oculus Rift CV1 controllers. Tool not tested and probably won't work with Rift S/Oculus Quest controllers. 5 | 6 | ![Application main window](https://i.imgur.com/iNPT9Xp.png) 7 | 8 | --- 9 | 10 | ## Usage 11 | 12 | * Extract archive anywhere 13 | * Close all VR applications, SteamVR and Oculus desktop software if running 14 | * Launch the tool. It will require Administrator rights for restarting OVRService 15 | * Select Touch controller to calibrate in dropdown menu 16 | * To increase deadzone, decrease values -X and -Y or increase values of +X and +Y. I recommend increasing and decreasing values by about 50 17 | * Press Save button then Restart OVRService 18 | * Launch Oculus software and check if issue is fixed 19 | * Repeat above steps if you still experiencing thumbstick self-activation issue. In some extreme cases you may need to change deadzone value by about 200. For example when my thumbstick started behaiving weird I had to decrease -X deadzone from 502 to 380. 20 | 21 | ## UI buttons 22 | 23 | * Restore original files - restores original calibration files from backup folder. These files are backed up when tool started for the first time. 24 | * Reset values - reload deadzone values from calibration file 25 | * Save - save changes to calibration file 26 | * Restart OVRService - restart OVRService to apply calibration changes. Oculus desktop software should be closed prior restarting. 27 | 28 | ## Examples 29 | 30 | I mainly made this tool to fix random avatar movement in VRChat but it also can be used for other games. 31 | * If your avatar started randomly moving forward when you just slightly touching thumbstick, increase Deadzone +Y value. 32 | * If your avatar started randomly moving backward, decrease Deadzone -Y value. 33 | * If your avatar started randomly moving left, decrease Deadzone -X value. 34 | * If your avatar started randomly moving right, increase Deadzone +X value. 35 | * If your avatar started randomly rotationg left, decrease Deadzone -X value of right controller. 36 | * If your avatar started randomly rotationg right, increase Deadzone +X value of right controller. 37 | -------------------------------------------------------------------------------- /OculusTouchCalibration/CalibrationData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace OculusTouchCalibration 4 | { 5 | [Serializable] 6 | public class CalibrationData 7 | { 8 | public TrackedObject TrackedObject; 9 | } 10 | 11 | [Serializable] 12 | public class TrackedObject 13 | { 14 | public int JsonVersion; 15 | public int JoyXRangeMax; 16 | public int JoyXRangeMin; 17 | public int JoyYRangeMax; 18 | public int JoyYRangeMin; 19 | public int JoyXDeadMax; 20 | public int JoyXDeadMin; 21 | public int JoyYDeadMax; 22 | public int JoyYDeadMin; 23 | public int TriggerMaxRange; 24 | public int TriggerMidRange; 25 | public int TriggerMinRange; 26 | public int MiddleMaxRange; 27 | public int MiddleMidRange; 28 | public int MiddleMinRange; 29 | public bool MiddleFlipped; 30 | public string IrLedConfig; 31 | public double[] ImuPosition; 32 | public double[] GyroCalibration; 33 | public double[] AccCalibration; 34 | public int[] CapSenseMin; 35 | public int[] CapSenseTouch; 36 | public ModelPoints ModelPoints; 37 | public Lensing Lensing; 38 | } 39 | 40 | [Serializable] 41 | public class ModelPoints 42 | { 43 | public decimal[] Point0; 44 | public decimal[] Point1; 45 | public decimal[] Point2; 46 | public decimal[] Point3; 47 | public decimal[] Point4; 48 | public decimal[] Point5; 49 | public decimal[] Point6; 50 | public decimal[] Point7; 51 | public decimal[] Point8; 52 | public decimal[] Point9; 53 | public decimal[] Point10; 54 | public decimal[] Point11; 55 | public decimal[] Point12; 56 | public decimal[] Point13; 57 | public decimal[] Point14; 58 | public decimal[] Point15; 59 | public decimal[] Point16; 60 | public decimal[] Point17; 61 | public decimal[] Point18; 62 | public decimal[] Point19; 63 | public decimal[] Point20; 64 | public decimal[] Point21; 65 | public decimal[] Point22; 66 | public decimal[] Point23; 67 | } 68 | 69 | [Serializable] 70 | public class Lensing 71 | { 72 | public double[] Model0; 73 | public double[] Model1; 74 | public double[] Model2; 75 | } 76 | } -------------------------------------------------------------------------------- /OculusTouchCalibration/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OculusTouchCalibration.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OculusTouchCalibration.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /OculusTouchCalibration/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 59 | 60 | 61 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /OculusTouchCalibration/OculusTouchCalibration.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {AEB50259-EBCD-4340-A736-C4FCA708EBE0} 8 | WinExe 9 | OculusTouchCalibration 10 | OculusTouchCalibration 11 | v4.6.1 12 | 512 13 | true 14 | false 15 | publish\ 16 | true 17 | Disk 18 | false 19 | Foreground 20 | 7 21 | Days 22 | false 23 | false 24 | true 25 | 0 26 | 1.0.0.%2a 27 | false 28 | true 29 | 30 | 31 | AnyCPU 32 | true 33 | full 34 | false 35 | bin\Debug\ 36 | DEBUG;TRACE 37 | prompt 38 | 4 39 | true 40 | 41 | 42 | AnyCPU 43 | pdbonly 44 | true 45 | bin\Release\ 46 | TRACE 47 | prompt 48 | 4 49 | 50 | 51 | OculusTouchCalibration.Program 52 | 53 | 54 | app.manifest 55 | 56 | 57 | 58 | ..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | Form 78 | 79 | 80 | Form1.cs 81 | 82 | 83 | 84 | 85 | Form1.cs 86 | 87 | 88 | ResXFileCodeGenerator 89 | Resources.Designer.cs 90 | Designer 91 | 92 | 93 | True 94 | Resources.resx 95 | 96 | 97 | Designer 98 | 99 | 100 | 101 | SettingsSingleFileGenerator 102 | Settings.Designer.cs 103 | 104 | 105 | True 106 | Settings.settings 107 | True 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | False 116 | Microsoft .NET Framework 4.6.1 %28x86 and x64%29 117 | true 118 | 119 | 120 | False 121 | .NET Framework 3.5 SP1 122 | false 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /OculusTouchCalibration/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /OculusTouchCalibration/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignorable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | *.ndf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | node_modules/ 238 | 239 | # Typescript v1 declaration files 240 | typings/ 241 | 242 | # Visual Studio 6 build log 243 | *.plg 244 | 245 | # Visual Studio 6 workspace options file 246 | *.opt 247 | 248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 249 | *.vbw 250 | 251 | # Visual Studio LightSwitch build output 252 | **/*.HTMLClient/GeneratedArtifacts 253 | **/*.DesktopClient/GeneratedArtifacts 254 | **/*.DesktopClient/ModelManifest.xml 255 | **/*.Server/GeneratedArtifacts 256 | **/*.Server/ModelManifest.xml 257 | _Pvt_Extensions 258 | 259 | # Paket dependency manager 260 | .paket/paket.exe 261 | paket-files/ 262 | 263 | # FAKE - F# Make 264 | .fake/ 265 | 266 | # JetBrains Rider 267 | .idea/ 268 | *.sln.iml 269 | 270 | # CodeRush 271 | .cr/ 272 | 273 | # Python Tools for Visual Studio (PTVS) 274 | __pycache__/ 275 | *.pyc 276 | 277 | # Cake - Uncomment if you are using it 278 | # tools/** 279 | # !tools/packages.config 280 | 281 | # Telerik's JustMock configuration file 282 | *.jmconfig 283 | 284 | # BizTalk build output 285 | *.btp.cs 286 | *.btm.cs 287 | *.odx.cs 288 | *.xsd.cs 289 | -------------------------------------------------------------------------------- /OculusTouchCalibration/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Security.Principal; 6 | using System.ServiceProcess; 7 | using System.Windows.Forms; 8 | using Newtonsoft.Json; 9 | 10 | namespace OculusTouchCalibration 11 | { 12 | public partial class Form1 : Form 13 | { 14 | private const string LTOUCH = ".ltouch"; 15 | private const string RTOUCH = ".rtouch"; 16 | private const string OBJECT = ".object"; 17 | 18 | private static CalibrationData loadedData; 19 | 20 | private static string appdataDirectory; 21 | private static string oculusDirectory; 22 | private static string oculusDeviceCachePath; 23 | private static string calibrationDirectory; 24 | private static string appDirectory; 25 | private static string backupDirectory; 26 | 27 | private static Dictionary m_ControllerDict; 28 | private static byte[] endBytes; 29 | 30 | public Form1() 31 | { 32 | InitializeComponent(); 33 | 34 | appdataDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 35 | oculusDirectory = Path.Combine(appdataDirectory, "Oculus"); 36 | oculusDeviceCachePath = Path.Combine(oculusDirectory, "DeviceCache.json"); 37 | calibrationDirectory = Path.Combine(oculusDirectory, "TouchCalibration"); 38 | appDirectory = Path.Combine(appdataDirectory, "TouchDeadzoneTool"); 39 | backupDirectory = Path.Combine(appDirectory, "Backup"); 40 | 41 | Directory.CreateDirectory(appDirectory); 42 | Directory.CreateDirectory(backupDirectory); 43 | 44 | m_ControllerDict = new Dictionary(); 45 | 46 | BackupConfigs(); 47 | 48 | FillControllerList(); 49 | } 50 | 51 | // Copy calibration files to backup folder 52 | private void BackupConfigs() 53 | { 54 | string fileName = string.Empty; 55 | string destFile = string.Empty; 56 | 57 | if (Directory.Exists(calibrationDirectory)) 58 | { 59 | string[] files = Directory.GetFiles(calibrationDirectory); 60 | 61 | foreach (string s in files) 62 | { 63 | fileName = Path.GetFileName(s); 64 | destFile = Path.Combine(backupDirectory, fileName); 65 | if (!File.Exists(s)) 66 | { 67 | File.Copy(s, destFile, false); 68 | } 69 | } 70 | } 71 | } 72 | 73 | // Restore original json files from backup 74 | private void RestoreFromBackup() 75 | { 76 | string fileName = string.Empty; 77 | string destFile = string.Empty; 78 | 79 | if (Directory.Exists(backupDirectory)) 80 | { 81 | string[] files = Directory.GetFiles(backupDirectory); 82 | 83 | foreach (string s in files) 84 | { 85 | fileName = Path.GetFileName(s); 86 | destFile = Path.Combine(calibrationDirectory, fileName); 87 | File.Copy(s, destFile, true); 88 | } 89 | } 90 | } 91 | 92 | // Save changes to json files 93 | private void button1_Click(object sender, EventArgs e) 94 | { 95 | string saveFolder = Application.StartupPath; 96 | 97 | loadedData.TrackedObject.JoyYDeadMax = Decimal.ToInt32(numYmax.Value); 98 | loadedData.TrackedObject.JoyYDeadMin = Decimal.ToInt32(numYmin.Value); 99 | loadedData.TrackedObject.JoyXDeadMax = Decimal.ToInt32(numXmax.Value); 100 | loadedData.TrackedObject.JoyXDeadMin = Decimal.ToInt32(numXmin.Value); 101 | 102 | string outputData = JsonConvert.SerializeObject(loadedData, Formatting.None, new DecimalJsonConverter()); 103 | byte[] bytes = Encoding.ASCII.GetBytes(outputData); 104 | byte[] byteOutput = new byte[bytes.Length + endBytes.Length]; 105 | Buffer.BlockCopy(bytes, 0, byteOutput, 0, bytes.Length); 106 | Buffer.BlockCopy(endBytes, 0, byteOutput, bytes.Length, endBytes.Length); 107 | 108 | string saveFilename; 109 | m_ControllerDict.TryGetValue(comboBox1.Text, out saveFilename); 110 | 111 | if (!string.IsNullOrEmpty(saveFilename)) 112 | { 113 | //System.IO.File.WriteAllBytes(saveFolder + "\\" + saveFilename, byteOutput); 114 | System.IO.File.WriteAllBytes(calibrationDirectory + "\\" + saveFilename, byteOutput); 115 | } 116 | 117 | lbl_Status.Text = "Please restart OVRService to apply changes."; 118 | } 119 | 120 | // Populate controller list 121 | private void FillControllerList() 122 | { 123 | comboBox1.Items.Clear(); 124 | m_ControllerDict.Clear(); 125 | 126 | if (!Directory.Exists(calibrationDirectory)) 127 | { 128 | MessageBox.Show("Path: " + calibrationDirectory + " not found!", "Error"); 129 | btn_Reset.Enabled = false; 130 | btn_RestartOVR.Enabled = false; 131 | btn_RestoreOriginal.Enabled = false; 132 | btn_Save.Enabled = false; 133 | lbl_Status.Text = "Oculus software configuration directory not found!"; 134 | return; 135 | } 136 | 137 | string[] fileEntries = Directory.GetFiles(calibrationDirectory); 138 | string userFriendlyName = ""; 139 | 140 | string deviceCacheData = System.IO.File.ReadAllText(oculusDeviceCachePath); 141 | 142 | foreach (string filePath in fileEntries) 143 | { 144 | string fileName = Path.GetFileName(filePath); 145 | string fileExtension = Path.GetExtension(filePath); 146 | string id = fileName.Substring(0, 14); 147 | if (deviceCacheData.IndexOf(id) > -1) 148 | { 149 | switch (fileExtension) 150 | { 151 | case LTOUCH: 152 | userFriendlyName = "Left Touch Controller - " + id; 153 | break; 154 | case RTOUCH: 155 | userFriendlyName = "Right Touch Controller - " + id; 156 | break; 157 | case OBJECT: 158 | userFriendlyName = "Tracked Object - " + id; 159 | break; 160 | default: 161 | continue; 162 | } 163 | 164 | m_ControllerDict.Add(userFriendlyName, fileName); 165 | 166 | comboBox1.Items.Add(userFriendlyName); 167 | } 168 | } 169 | 170 | comboBox1.SelectedIndex = 0; 171 | } 172 | 173 | // Read calibration data for selected controller 174 | private void ReadValues(string fileName) 175 | { 176 | string saveFolder = Application.StartupPath; 177 | 178 | string inputData = System.IO.File.ReadAllText(Path.Combine(calibrationDirectory, fileName)); 179 | byte[] inputByteData = System.IO.File.ReadAllBytes(Path.Combine(calibrationDirectory, fileName)); 180 | 181 | endBytes = new byte[8]; 182 | for (int i = inputByteData.Length; i > 0; i--) 183 | { 184 | char currentChar = Convert.ToChar(inputByteData[i - 1]); 185 | if (currentChar.Equals('}')) 186 | { 187 | int len = inputByteData.Length - i; 188 | endBytes = new byte[len]; 189 | for (int j = 0; j < len; j++) 190 | { 191 | endBytes[j] = inputByteData[i + j]; 192 | } 193 | break; 194 | } 195 | } 196 | 197 | int jsonEnd = inputData.LastIndexOf('}') + 1; 198 | 199 | Encoding enc = Encoding.ASCII; 200 | string closingSymbols = enc.GetString(endBytes); 201 | 202 | inputData = inputData.Remove(jsonEnd); 203 | loadedData = JsonConvert.DeserializeObject(inputData); 204 | 205 | numXmax.Maximum = loadedData.TrackedObject.JoyXRangeMax; 206 | numXmax.Minimum = loadedData.TrackedObject.JoyXRangeMin; 207 | numXmin.Maximum = loadedData.TrackedObject.JoyXRangeMax; 208 | numXmin.Minimum = loadedData.TrackedObject.JoyXRangeMin; 209 | numYmax.Maximum = loadedData.TrackedObject.JoyYRangeMax; 210 | numYmax.Minimum = loadedData.TrackedObject.JoyYRangeMin; 211 | numYmin.Maximum = loadedData.TrackedObject.JoyYRangeMax; 212 | numYmin.Minimum = loadedData.TrackedObject.JoyYRangeMin; 213 | 214 | numXmax.Value = loadedData.TrackedObject.JoyXDeadMax; 215 | numXmin.Value = loadedData.TrackedObject.JoyXDeadMin; 216 | numYmax.Value = loadedData.TrackedObject.JoyYDeadMax; 217 | numYmin.Value = loadedData.TrackedObject.JoyYDeadMin; 218 | 219 | numXmin.Maximum = numXmax.Value; 220 | numXmax.Minimum = numXmin.Value; 221 | numYmin.Maximum = numYmax.Value; 222 | numYmax.Minimum = numYmin.Value; 223 | 224 | lblRangeXmax.Text = loadedData.TrackedObject.JoyXRangeMax.ToString(); 225 | lblRangeXmin.Text = loadedData.TrackedObject.JoyXRangeMin.ToString(); 226 | lblRangeYmax.Text = loadedData.TrackedObject.JoyYRangeMax.ToString(); 227 | lblRangeYmin.Text = loadedData.TrackedObject.JoyYRangeMin.ToString(); 228 | } 229 | 230 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) 231 | { 232 | string filename; 233 | m_ControllerDict.TryGetValue(comboBox1.Text, out filename); 234 | 235 | if (!string.IsNullOrEmpty(filename)) 236 | ReadValues(filename); 237 | } 238 | 239 | // Reset fields values to default 240 | private void button2_Click(object sender, EventArgs e) 241 | { 242 | numXmax.Value = loadedData.TrackedObject.JoyXDeadMax; 243 | numXmin.Value = loadedData.TrackedObject.JoyXDeadMin; 244 | numYmax.Value = loadedData.TrackedObject.JoyYDeadMax; 245 | numYmin.Value = loadedData.TrackedObject.JoyYDeadMin; 246 | } 247 | 248 | private void numXmax_ValueChanged(object sender, EventArgs e) 249 | { 250 | numXmin.Maximum = numXmax.Value; 251 | } 252 | 253 | private void numXmin_ValueChanged(object sender, EventArgs e) 254 | { 255 | numXmax.Minimum = numXmin.Value; 256 | } 257 | 258 | private void numYmax_ValueChanged(object sender, EventArgs e) 259 | { 260 | numYmin.Maximum = numYmax.Value; 261 | } 262 | 263 | private void numYmin_ValueChanged(object sender, EventArgs e) 264 | { 265 | numYmax.Minimum = numYmin.Value; 266 | } 267 | 268 | private void btn_RestoreOriginal_Click(object sender, EventArgs e) 269 | { 270 | string[] files = Directory.GetFiles(backupDirectory); 271 | if (files.Length == 0) 272 | { 273 | MessageBox.Show("Backup files not found!", "Error"); 274 | return; 275 | } 276 | 277 | DialogResult dialogResult = MessageBox.Show("Do you want to reset custom deadzone values and restore original configuration files from the backup?", "Confirmation", MessageBoxButtons.YesNo); 278 | if (dialogResult == DialogResult.Yes) 279 | { 280 | RestoreFromBackup(); 281 | FillControllerList(); 282 | } 283 | 284 | lbl_Status.Text = "Original files restored! Please restart OVRService to apply changes."; 285 | } 286 | 287 | // Restart OVRService 288 | public void RestartService(string serviceName) 289 | { 290 | if (!IsUserAdministrator()) 291 | { 292 | MessageBox.Show("Can not restart OVRService.\nPlease run application as Administrator!", "Error"); 293 | return; 294 | } 295 | 296 | ServiceController service = new ServiceController(serviceName); 297 | TimeSpan timeout = TimeSpan.FromMinutes(1); 298 | if (service.Status != ServiceControllerStatus.Stopped) 299 | { 300 | lbl_Status.Text = "Stopping OVRServce. Please wait..."; 301 | Application.DoEvents(); 302 | 303 | // Stop Service 304 | service.Stop(); 305 | Application.DoEvents(); 306 | service.WaitForStatus(ServiceControllerStatus.Stopped, timeout); 307 | Application.DoEvents(); 308 | } 309 | //Restart service 310 | lbl_Status.Text = "Restarting OVRServce. Please wait..."; 311 | Application.DoEvents(); 312 | service.Start(); 313 | service.WaitForStatus(ServiceControllerStatus.Running, timeout); 314 | Application.DoEvents(); 315 | lbl_Status.Text = "OVRServce restarted!"; 316 | } 317 | 318 | private void button3_Click(object sender, EventArgs e) 319 | { 320 | RestartService("OVRService"); 321 | } 322 | 323 | // Check if software is running with Administrator privileges 324 | private static bool IsUserAdministrator() 325 | { 326 | bool isAdmin; 327 | try 328 | { 329 | WindowsIdentity user = WindowsIdentity.GetCurrent(); 330 | WindowsPrincipal principal = new WindowsPrincipal(user); 331 | isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); 332 | } 333 | catch (UnauthorizedAccessException ex) 334 | { 335 | isAdmin = false; 336 | MessageBox.Show(ex.Message, "UnauthorizedAccessException"); 337 | } 338 | catch (Exception ex) 339 | { 340 | isAdmin = false; 341 | MessageBox.Show(ex.Message, "Exception"); 342 | } 343 | return isAdmin; 344 | } 345 | } 346 | } 347 | -------------------------------------------------------------------------------- /OculusTouchCalibration/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace OculusTouchCalibration 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.btn_Save = new System.Windows.Forms.Button(); 32 | this.comboBox1 = new System.Windows.Forms.ComboBox(); 33 | this.numXmin = new System.Windows.Forms.NumericUpDown(); 34 | this.numXmax = new System.Windows.Forms.NumericUpDown(); 35 | this.numYmax = new System.Windows.Forms.NumericUpDown(); 36 | this.numYmin = new System.Windows.Forms.NumericUpDown(); 37 | this.lblRangeXmin = new System.Windows.Forms.Label(); 38 | this.lblRangeXmax = new System.Windows.Forms.Label(); 39 | this.lblRangeYmax = new System.Windows.Forms.Label(); 40 | this.lblRangeYmin = new System.Windows.Forms.Label(); 41 | this.btn_Reset = new System.Windows.Forms.Button(); 42 | this.label1 = new System.Windows.Forms.Label(); 43 | this.label2 = new System.Windows.Forms.Label(); 44 | this.label3 = new System.Windows.Forms.Label(); 45 | this.label4 = new System.Windows.Forms.Label(); 46 | this.label5 = new System.Windows.Forms.Label(); 47 | this.label6 = new System.Windows.Forms.Label(); 48 | this.label7 = new System.Windows.Forms.Label(); 49 | this.label8 = new System.Windows.Forms.Label(); 50 | this.btn_RestoreOriginal = new System.Windows.Forms.Button(); 51 | this.btn_RestartOVR = new System.Windows.Forms.Button(); 52 | this.label9 = new System.Windows.Forms.Label(); 53 | this.label10 = new System.Windows.Forms.Label(); 54 | this.lbl_Status = new System.Windows.Forms.Label(); 55 | ((System.ComponentModel.ISupportInitialize)(this.numXmin)).BeginInit(); 56 | ((System.ComponentModel.ISupportInitialize)(this.numXmax)).BeginInit(); 57 | ((System.ComponentModel.ISupportInitialize)(this.numYmax)).BeginInit(); 58 | ((System.ComponentModel.ISupportInitialize)(this.numYmin)).BeginInit(); 59 | this.SuspendLayout(); 60 | // 61 | // btn_Save 62 | // 63 | this.btn_Save.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 64 | this.btn_Save.Location = new System.Drawing.Point(302, 232); 65 | this.btn_Save.Name = "btn_Save"; 66 | this.btn_Save.Size = new System.Drawing.Size(75, 23); 67 | this.btn_Save.TabIndex = 0; 68 | this.btn_Save.Text = "Save"; 69 | this.btn_Save.UseVisualStyleBackColor = true; 70 | this.btn_Save.Click += new System.EventHandler(this.button1_Click); 71 | // 72 | // comboBox1 73 | // 74 | this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 75 | this.comboBox1.FormattingEnabled = true; 76 | this.comboBox1.Location = new System.Drawing.Point(122, 10); 77 | this.comboBox1.Name = "comboBox1"; 78 | this.comboBox1.Size = new System.Drawing.Size(255, 21); 79 | this.comboBox1.TabIndex = 1; 80 | this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); 81 | // 82 | // numXmin 83 | // 84 | this.numXmin.Location = new System.Drawing.Point(80, 117); 85 | this.numXmin.Name = "numXmin"; 86 | this.numXmin.Size = new System.Drawing.Size(50, 20); 87 | this.numXmin.TabIndex = 2; 88 | this.numXmin.ValueChanged += new System.EventHandler(this.numXmin_ValueChanged); 89 | // 90 | // numXmax 91 | // 92 | this.numXmax.Location = new System.Drawing.Point(205, 117); 93 | this.numXmax.Name = "numXmax"; 94 | this.numXmax.Size = new System.Drawing.Size(50, 20); 95 | this.numXmax.TabIndex = 3; 96 | this.numXmax.ValueChanged += new System.EventHandler(this.numXmax_ValueChanged); 97 | // 98 | // numYmax 99 | // 100 | this.numYmax.Location = new System.Drawing.Point(143, 62); 101 | this.numYmax.Name = "numYmax"; 102 | this.numYmax.Size = new System.Drawing.Size(50, 20); 103 | this.numYmax.TabIndex = 4; 104 | this.numYmax.ValueChanged += new System.EventHandler(this.numYmax_ValueChanged); 105 | // 106 | // numYmin 107 | // 108 | this.numYmin.Location = new System.Drawing.Point(143, 173); 109 | this.numYmin.Name = "numYmin"; 110 | this.numYmin.Size = new System.Drawing.Size(50, 20); 111 | this.numYmin.TabIndex = 5; 112 | this.numYmin.ValueChanged += new System.EventHandler(this.numYmin_ValueChanged); 113 | // 114 | // lblRangeXmin 115 | // 116 | this.lblRangeXmin.AutoSize = true; 117 | this.lblRangeXmin.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 118 | this.lblRangeXmin.ForeColor = System.Drawing.Color.Red; 119 | this.lblRangeXmin.Location = new System.Drawing.Point(119, 140); 120 | this.lblRangeXmin.Name = "lblRangeXmin"; 121 | this.lblRangeXmin.Size = new System.Drawing.Size(34, 13); 122 | this.lblRangeXmin.TabIndex = 6; 123 | this.lblRangeXmin.Text = "minX"; 124 | // 125 | // lblRangeXmax 126 | // 127 | this.lblRangeXmax.AutoSize = true; 128 | this.lblRangeXmax.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 129 | this.lblRangeXmax.ForeColor = System.Drawing.Color.Red; 130 | this.lblRangeXmax.Location = new System.Drawing.Point(247, 140); 131 | this.lblRangeXmax.Name = "lblRangeXmax"; 132 | this.lblRangeXmax.Size = new System.Drawing.Size(37, 13); 133 | this.lblRangeXmax.TabIndex = 7; 134 | this.lblRangeXmax.Text = "maxX"; 135 | // 136 | // lblRangeYmax 137 | // 138 | this.lblRangeYmax.AutoSize = true; 139 | this.lblRangeYmax.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 140 | this.lblRangeYmax.ForeColor = System.Drawing.Color.Red; 141 | this.lblRangeYmax.Location = new System.Drawing.Point(185, 85); 142 | this.lblRangeYmax.Name = "lblRangeYmax"; 143 | this.lblRangeYmax.Size = new System.Drawing.Size(37, 13); 144 | this.lblRangeYmax.TabIndex = 8; 145 | this.lblRangeYmax.Text = "maxY"; 146 | // 147 | // lblRangeYmin 148 | // 149 | this.lblRangeYmin.AutoSize = true; 150 | this.lblRangeYmin.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 151 | this.lblRangeYmin.ForeColor = System.Drawing.Color.Red; 152 | this.lblRangeYmin.Location = new System.Drawing.Point(182, 196); 153 | this.lblRangeYmin.Name = "lblRangeYmin"; 154 | this.lblRangeYmin.Size = new System.Drawing.Size(34, 13); 155 | this.lblRangeYmin.TabIndex = 9; 156 | this.lblRangeYmin.Text = "minY"; 157 | // 158 | // btn_Reset 159 | // 160 | this.btn_Reset.Location = new System.Drawing.Point(136, 232); 161 | this.btn_Reset.Name = "btn_Reset"; 162 | this.btn_Reset.Size = new System.Drawing.Size(80, 23); 163 | this.btn_Reset.TabIndex = 10; 164 | this.btn_Reset.Text = "Reset values"; 165 | this.btn_Reset.UseVisualStyleBackColor = true; 166 | this.btn_Reset.Click += new System.EventHandler(this.button2_Click); 167 | // 168 | // label1 169 | // 170 | this.label1.AutoSize = true; 171 | this.label1.Location = new System.Drawing.Point(140, 85); 172 | this.label1.Name = "label1"; 173 | this.label1.Size = new System.Drawing.Size(39, 13); 174 | this.label1.TabIndex = 11; 175 | this.label1.Text = "Y max:"; 176 | // 177 | // label2 178 | // 179 | this.label2.AutoSize = true; 180 | this.label2.Location = new System.Drawing.Point(140, 196); 181 | this.label2.Name = "label2"; 182 | this.label2.Size = new System.Drawing.Size(36, 13); 183 | this.label2.TabIndex = 12; 184 | this.label2.Text = "Y min:"; 185 | // 186 | // label3 187 | // 188 | this.label3.AutoSize = true; 189 | this.label3.Location = new System.Drawing.Point(77, 140); 190 | this.label3.Name = "label3"; 191 | this.label3.Size = new System.Drawing.Size(36, 13); 192 | this.label3.TabIndex = 13; 193 | this.label3.Text = "X min:"; 194 | // 195 | // label4 196 | // 197 | this.label4.AutoSize = true; 198 | this.label4.Location = new System.Drawing.Point(202, 140); 199 | this.label4.Name = "label4"; 200 | this.label4.Size = new System.Drawing.Size(39, 13); 201 | this.label4.TabIndex = 14; 202 | this.label4.Text = "X max:"; 203 | // 204 | // label5 205 | // 206 | this.label5.AutoSize = true; 207 | this.label5.Location = new System.Drawing.Point(119, 46); 208 | this.label5.Name = "label5"; 209 | this.label5.Size = new System.Drawing.Size(95, 13); 210 | this.label5.TabIndex = 15; 211 | this.label5.Text = "Deadzone +Y (Up)"; 212 | // 213 | // label6 214 | // 215 | this.label6.AutoSize = true; 216 | this.label6.Location = new System.Drawing.Point(57, 101); 217 | this.label6.Name = "label6"; 218 | this.label6.Size = new System.Drawing.Size(96, 13); 219 | this.label6.TabIndex = 16; 220 | this.label6.Text = "Deadzone -X (Left)"; 221 | // 222 | // label7 223 | // 224 | this.label7.AutoSize = true; 225 | this.label7.Location = new System.Drawing.Point(119, 157); 226 | this.label7.Name = "label7"; 227 | this.label7.Size = new System.Drawing.Size(106, 13); 228 | this.label7.TabIndex = 17; 229 | this.label7.Text = "Deadzone -Y (Down)"; 230 | // 231 | // label8 232 | // 233 | this.label8.AutoSize = true; 234 | this.label8.Location = new System.Drawing.Point(182, 101); 235 | this.label8.Name = "label8"; 236 | this.label8.Size = new System.Drawing.Size(106, 13); 237 | this.label8.TabIndex = 18; 238 | this.label8.Text = "Deadzone +X (Right)"; 239 | // 240 | // btn_RestoreOriginal 241 | // 242 | this.btn_RestoreOriginal.Location = new System.Drawing.Point(12, 232); 243 | this.btn_RestoreOriginal.Name = "btn_RestoreOriginal"; 244 | this.btn_RestoreOriginal.Size = new System.Drawing.Size(118, 23); 245 | this.btn_RestoreOriginal.TabIndex = 19; 246 | this.btn_RestoreOriginal.Text = "Restore original files"; 247 | this.btn_RestoreOriginal.UseVisualStyleBackColor = true; 248 | this.btn_RestoreOriginal.Click += new System.EventHandler(this.btn_RestoreOriginal_Click); 249 | // 250 | // btn_RestartOVR 251 | // 252 | this.btn_RestartOVR.Location = new System.Drawing.Point(259, 261); 253 | this.btn_RestartOVR.Name = "btn_RestartOVR"; 254 | this.btn_RestartOVR.Size = new System.Drawing.Size(118, 23); 255 | this.btn_RestartOVR.TabIndex = 20; 256 | this.btn_RestartOVR.Text = "Restart OVRService"; 257 | this.btn_RestartOVR.UseVisualStyleBackColor = true; 258 | this.btn_RestartOVR.Click += new System.EventHandler(this.button3_Click); 259 | // 260 | // label9 261 | // 262 | this.label9.AutoSize = true; 263 | this.label9.Location = new System.Drawing.Point(12, 13); 264 | this.label9.Name = "label9"; 265 | this.label9.Size = new System.Drawing.Size(109, 13); 266 | this.label9.TabIndex = 21; 267 | this.label9.Text = "Controller to calibrate:"; 268 | // 269 | // label10 270 | // 271 | this.label10.AutoSize = true; 272 | this.label10.Location = new System.Drawing.Point(9, 287); 273 | this.label10.Name = "label10"; 274 | this.label10.Size = new System.Drawing.Size(40, 13); 275 | this.label10.TabIndex = 22; 276 | this.label10.Text = "Status:"; 277 | // 278 | // lbl_Status 279 | // 280 | this.lbl_Status.AutoSize = true; 281 | this.lbl_Status.Font = new System.Drawing.Font("Microsoft Uighur", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 282 | this.lbl_Status.ForeColor = System.Drawing.SystemColors.MenuHighlight; 283 | this.lbl_Status.Location = new System.Drawing.Point(55, 287); 284 | this.lbl_Status.Name = "lbl_Status"; 285 | this.lbl_Status.Size = new System.Drawing.Size(35, 14); 286 | this.lbl_Status.TabIndex = 23; 287 | this.lbl_Status.Text = "ready"; 288 | // 289 | // Form1 290 | // 291 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 292 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 293 | this.ClientSize = new System.Drawing.Size(389, 309); 294 | this.Controls.Add(this.lbl_Status); 295 | this.Controls.Add(this.label10); 296 | this.Controls.Add(this.label9); 297 | this.Controls.Add(this.btn_RestartOVR); 298 | this.Controls.Add(this.btn_RestoreOriginal); 299 | this.Controls.Add(this.label8); 300 | this.Controls.Add(this.label7); 301 | this.Controls.Add(this.label6); 302 | this.Controls.Add(this.label5); 303 | this.Controls.Add(this.label4); 304 | this.Controls.Add(this.label3); 305 | this.Controls.Add(this.label2); 306 | this.Controls.Add(this.label1); 307 | this.Controls.Add(this.btn_Reset); 308 | this.Controls.Add(this.lblRangeYmin); 309 | this.Controls.Add(this.lblRangeYmax); 310 | this.Controls.Add(this.lblRangeXmax); 311 | this.Controls.Add(this.lblRangeXmin); 312 | this.Controls.Add(this.numYmin); 313 | this.Controls.Add(this.numYmax); 314 | this.Controls.Add(this.numXmax); 315 | this.Controls.Add(this.numXmin); 316 | this.Controls.Add(this.comboBox1); 317 | this.Controls.Add(this.btn_Save); 318 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 319 | this.MaximizeBox = false; 320 | this.Name = "Form1"; 321 | this.Text = "Oculus Touch Deadzone Calibration Tool"; 322 | ((System.ComponentModel.ISupportInitialize)(this.numXmin)).EndInit(); 323 | ((System.ComponentModel.ISupportInitialize)(this.numXmax)).EndInit(); 324 | ((System.ComponentModel.ISupportInitialize)(this.numYmax)).EndInit(); 325 | ((System.ComponentModel.ISupportInitialize)(this.numYmin)).EndInit(); 326 | this.ResumeLayout(false); 327 | this.PerformLayout(); 328 | 329 | } 330 | 331 | #endregion 332 | 333 | private System.Windows.Forms.Button btn_Save; 334 | private System.Windows.Forms.ComboBox comboBox1; 335 | private System.Windows.Forms.NumericUpDown numXmin; 336 | private System.Windows.Forms.NumericUpDown numXmax; 337 | private System.Windows.Forms.NumericUpDown numYmax; 338 | private System.Windows.Forms.NumericUpDown numYmin; 339 | private System.Windows.Forms.Label lblRangeXmin; 340 | private System.Windows.Forms.Label lblRangeXmax; 341 | private System.Windows.Forms.Label lblRangeYmax; 342 | private System.Windows.Forms.Label lblRangeYmin; 343 | private System.Windows.Forms.Button btn_Reset; 344 | private System.Windows.Forms.Label label1; 345 | private System.Windows.Forms.Label label2; 346 | private System.Windows.Forms.Label label3; 347 | private System.Windows.Forms.Label label4; 348 | private System.Windows.Forms.Label label5; 349 | private System.Windows.Forms.Label label6; 350 | private System.Windows.Forms.Label label7; 351 | private System.Windows.Forms.Label label8; 352 | private System.Windows.Forms.Button btn_RestoreOriginal; 353 | private System.Windows.Forms.Button btn_RestartOVR; 354 | private System.Windows.Forms.Label label9; 355 | private System.Windows.Forms.Label label10; 356 | private System.Windows.Forms.Label lbl_Status; 357 | } 358 | } 359 | 360 | --------------------------------------------------------------------------------