Consolidation and adding rebracer settings.
authorsl
Mon, 29 Dec 2014 11:45:33 +0100
changeset 47bd068db7779a
parent 46 cbddac7b53e7
child 48 1eb878505ae1
Consolidation and adding rebracer settings.
HidDevice.cs
HidEvent.cs
RawInput.cs
Rebracer.xml
RemoteControlSample.sln
     1.1 --- a/HidDevice.cs	Sun Dec 28 22:37:21 2014 +0100
     1.2 +++ b/HidDevice.cs	Mon Dec 29 11:45:33 2014 +0100
     1.3 @@ -26,7 +26,7 @@
     1.4          public HidDevice(IntPtr hRawInputDevice)
     1.5          {
     1.6              //Fetch various information defining the given HID device
     1.7 -            Name = Win32.RawInput.GetDeviceName(hRawInputDevice);            
     1.8 +            Name = Win32.Utils.RawInput.GetDeviceName(hRawInputDevice);            
     1.9                  
    1.10              //Open our device from the device name/path
    1.11              SafeFileHandle handle=Win32.Function.CreateFile(Name,
     2.1 --- a/HidEvent.cs	Sun Dec 28 22:37:21 2014 +0100
     2.2 +++ b/HidEvent.cs	Mon Dec 29 11:45:33 2014 +0100
     2.3 @@ -104,14 +104,14 @@
     2.4              {
     2.5                  //Fetch raw input
     2.6                  RAWINPUT rawInput = new RAWINPUT();
     2.7 -                if (!RawInput.GetRawInputData(aMessage.LParam, ref rawInput, ref rawInputBuffer))
     2.8 +                if (!Win32.Utils.RawInput.GetRawInputData(aMessage.LParam, ref rawInput, ref rawInputBuffer))
     2.9                  {
    2.10                      return;
    2.11                  }
    2.12  
    2.13                  //Fetch device info
    2.14                  RID_DEVICE_INFO deviceInfo = new RID_DEVICE_INFO();
    2.15 -                if (!RawInput.GetDeviceInfo(rawInput.header.hDevice, ref deviceInfo))
    2.16 +                if (!Win32.Utils.RawInput.GetDeviceInfo(rawInput.header.hDevice, ref deviceInfo))
    2.17                  {
    2.18                      return;
    2.19                  }
    2.20 @@ -129,7 +129,7 @@
    2.21                      UsagePage = deviceInfo.hid.usUsagePage;
    2.22                      UsageCollection = deviceInfo.hid.usUsage;
    2.23  
    2.24 -                    preParsedData = RawInput.GetPreParsedData(rawInput.header.hDevice);
    2.25 +                    preParsedData = Win32.Utils.RawInput.GetPreParsedData(rawInput.header.hDevice);
    2.26  
    2.27                      if (!(rawInput.hid.dwSizeHid > 1     //Make sure our HID msg size more than 1. In fact the first ushort is irrelevant to us for now
    2.28                          && rawInput.hid.dwCount > 0))    //Check that we have at least one HID msg
    2.29 @@ -211,7 +211,8 @@
    2.30                  Marshal.FreeHGlobal(preParsedData);
    2.31              }
    2.32  
    2.33 -            if (Usages.Count>0 && Usages[0] != 0)
    2.34 +            //
    2.35 +            if (IsButtonDown)
    2.36              {
    2.37                  StartRepeatTimer(iRepeatDelay);
    2.38              }
     3.1 --- a/RawInput.cs	Sun Dec 28 22:37:21 2014 +0100
     3.2 +++ b/RawInput.cs	Mon Dec 29 11:45:33 2014 +0100
     3.3 @@ -3,7 +3,7 @@
     3.4  using System.Diagnostics;
     3.5  
     3.6  
     3.7 -namespace Win32
     3.8 +namespace Win32.Utils
     3.9  {
    3.10      /// <summary>
    3.11      /// Provide some utility functions for raw input handling.
    3.12 @@ -54,9 +54,8 @@
    3.13          /// <summary>
    3.14          /// 
    3.15          /// </summary>
    3.16 -        /// <param name="aRawInputHandle"></param>
    3.17 -        /// <param name="aUsagePage"></param>
    3.18 -        /// <param name="aUsage"></param>
    3.19 +        /// <param name="hDevice"></param>
    3.20 +        /// <param name="deviceInfo"></param>
    3.21          /// <returns></returns>
    3.22          public static bool GetDeviceInfo(IntPtr hDevice, ref RID_DEVICE_INFO deviceInfo)
    3.23          {
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/Rebracer.xml	Mon Dec 29 11:45:33 2014 +0100
     4.3 @@ -0,0 +1,119 @@
     4.4 +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
     4.5 +<!--Rebracer Solution Settings File-->
     4.6 +<!--This file contains Visual Studio settings for RemoteControlSample.sln.-->
     4.7 +<!--Rebracer uses this file to apply settings for this solution-->
     4.8 +<!--when the solution is opened.-->
     4.9 +<!--Install Rebracer from http://visualstudiogallery.msdn.microsoft.com/410e9b9f-65f3-4495-b68e-15567e543c58 -->
    4.10 +<!--See https://github.com/SLaks/Rebracer for more information-->
    4.11 +<UserSettings>
    4.12 +  <ToolsOptions>
    4.13 +    <ToolsOptionsCategory name="Environment">
    4.14 +      <ToolsOptionsSubCategory name="TaskList">
    4.15 +        <PropertyValue name="CommentTokens" ArrayType="VT_VARIANT" ArrayElementCount="4">
    4.16 +          <PropertyValue name="0">TODO:2</PropertyValue>
    4.17 +          <PropertyValue name="1">HACK:2</PropertyValue>
    4.18 +          <PropertyValue name="2">UNDONE:2</PropertyValue>
    4.19 +          <PropertyValue name="3">UnresolvedMergeConflict:3</PropertyValue>
    4.20 +        </PropertyValue>
    4.21 +        <PropertyValue name="ConfirmTaskDeletion">true</PropertyValue>
    4.22 +        <PropertyValue name="DontShowFilePaths">true</PropertyValue>
    4.23 +        <PropertyValue name="WarnOnAddingHiddenItem">false</PropertyValue>
    4.24 +      </ToolsOptionsSubCategory>
    4.25 +    </ToolsOptionsCategory>
    4.26 +    <ToolsOptionsCategory name="TextEditor">
    4.27 +      <ToolsOptionsSubCategory name="CSharp-Specific">
    4.28 +        <PropertyValue name="AutoComment">1</PropertyValue>
    4.29 +        <PropertyValue name="CodeDefinitionWindow_DocumentationComment_IndentBase">1</PropertyValue>
    4.30 +        <PropertyValue name="CodeDefinitionWindow_DocumentationComment_IndentOffset">2</PropertyValue>
    4.31 +        <PropertyValue name="CodeDefinitionWindow_DocumentationComment_WrapLength">80</PropertyValue>
    4.32 +        <PropertyValue name="Formatting_TriggerOnBlockCompletion">1</PropertyValue>
    4.33 +        <PropertyValue name="Formatting_TriggerOnPaste">1</PropertyValue>
    4.34 +        <PropertyValue name="Formatting_TriggerOnStatementCompletion">1</PropertyValue>
    4.35 +        <PropertyValue name="ImplementInterface_InsertRegionTags">0</PropertyValue>
    4.36 +        <PropertyValue name="Indent_BlockContents">1</PropertyValue>
    4.37 +        <PropertyValue name="Indent_Braces">0</PropertyValue>
    4.38 +        <PropertyValue name="Indent_CaseContents">1</PropertyValue>
    4.39 +        <PropertyValue name="Indent_CaseLabels">1</PropertyValue>
    4.40 +        <PropertyValue name="Indent_FlushLabelsLeft">0</PropertyValue>
    4.41 +        <PropertyValue name="Indent_UnindentLabels">1</PropertyValue>
    4.42 +        <PropertyValue name="NewLines_AnonymousTypeInitializer_EachMember">1</PropertyValue>
    4.43 +        <PropertyValue name="NewLines_Braces_AnonymousMethod">1</PropertyValue>
    4.44 +        <PropertyValue name="NewLines_Braces_AnonymousTypeInitializer">1</PropertyValue>
    4.45 +        <PropertyValue name="NewLines_Braces_ArrayInitializer">0</PropertyValue>
    4.46 +        <PropertyValue name="NewLines_Braces_CollectionInitializer">0</PropertyValue>
    4.47 +        <PropertyValue name="NewLines_Braces_ControlFlow">1</PropertyValue>
    4.48 +        <PropertyValue name="NewLines_Braces_LambdaExpressionBody">1</PropertyValue>
    4.49 +        <PropertyValue name="NewLines_Braces_Method">1</PropertyValue>
    4.50 +        <PropertyValue name="NewLines_Braces_ObjectInitializer">1</PropertyValue>
    4.51 +        <PropertyValue name="NewLines_Braces_Type">1</PropertyValue>
    4.52 +        <PropertyValue name="NewLines_Keywords_Catch">1</PropertyValue>
    4.53 +        <PropertyValue name="NewLines_Keywords_Else">1</PropertyValue>
    4.54 +        <PropertyValue name="NewLines_Keywords_Finally">1</PropertyValue>
    4.55 +        <PropertyValue name="NewLines_ObjectInitializer_EachMember">1</PropertyValue>
    4.56 +        <PropertyValue name="NewLines_QueryExpression_EachClause">1</PropertyValue>
    4.57 +        <PropertyValue name="RemoveUnusedUsings">1</PropertyValue>
    4.58 +        <PropertyValue name="SortUsings">1</PropertyValue>
    4.59 +        <PropertyValue name="SortUsings_PlaceSystemFirst">0</PropertyValue>
    4.60 +        <PropertyValue name="Space_AfterBasesColon">1</PropertyValue>
    4.61 +        <PropertyValue name="Space_AfterCast">0</PropertyValue>
    4.62 +        <PropertyValue name="Space_AfterComma">1</PropertyValue>
    4.63 +        <PropertyValue name="Space_AfterDot">0</PropertyValue>
    4.64 +        <PropertyValue name="Space_AfterLambdaArrow">1</PropertyValue>
    4.65 +        <PropertyValue name="Space_AfterMethodCallName">0</PropertyValue>
    4.66 +        <PropertyValue name="Space_AfterMethodDeclarationName">0</PropertyValue>
    4.67 +        <PropertyValue name="Space_AfterSemicolonsInForStatement">1</PropertyValue>
    4.68 +        <PropertyValue name="Space_AroundBinaryOperator">1</PropertyValue>
    4.69 +        <PropertyValue name="Space_BeforeBasesColon">1</PropertyValue>
    4.70 +        <PropertyValue name="Space_BeforeComma">0</PropertyValue>
    4.71 +        <PropertyValue name="Space_BeforeDot">0</PropertyValue>
    4.72 +        <PropertyValue name="Space_BeforeLambdaArrow">1</PropertyValue>
    4.73 +        <PropertyValue name="Space_BeforeOpenSquare">0</PropertyValue>
    4.74 +        <PropertyValue name="Space_BeforeSemicolonsInForStatement">0</PropertyValue>
    4.75 +        <PropertyValue name="Space_BetweenEmptyMethodCallParentheses">0</PropertyValue>
    4.76 +        <PropertyValue name="Space_BetweenEmptyMethodDeclarationParentheses">0</PropertyValue>
    4.77 +        <PropertyValue name="Space_BetweenEmptySquares">0</PropertyValue>
    4.78 +        <PropertyValue name="Space_InControlFlowConstruct">1</PropertyValue>
    4.79 +        <PropertyValue name="Space_Normalize">0</PropertyValue>
    4.80 +        <PropertyValue name="Space_WithinCastParentheses">0</PropertyValue>
    4.81 +        <PropertyValue name="Space_WithinExpressionParentheses">0</PropertyValue>
    4.82 +        <PropertyValue name="Space_WithinMethodCallParentheses">0</PropertyValue>
    4.83 +        <PropertyValue name="Space_WithinMethodDeclarationParentheses">0</PropertyValue>
    4.84 +        <PropertyValue name="Space_WithinOtherParentheses">0</PropertyValue>
    4.85 +        <PropertyValue name="Space_WithinSquares">0</PropertyValue>
    4.86 +        <PropertyValue name="WarnOnBuildErrors">1</PropertyValue>
    4.87 +        <PropertyValue name="WarnWhenMembersCauseCompilerGeneratedReferences">1</PropertyValue>
    4.88 +        <PropertyValue name="Wrapping_IgnoreSpacesAroundBinaryOperators">0</PropertyValue>
    4.89 +        <PropertyValue name="Wrapping_IgnoreSpacesAroundVariableDeclaration">0</PropertyValue>
    4.90 +        <PropertyValue name="Wrapping_KeepStatementsOnSingleLine">1</PropertyValue>
    4.91 +        <PropertyValue name="Wrapping_PreserveSingleLine">1</PropertyValue>
    4.92 +      </ToolsOptionsSubCategory>
    4.93 +      <ToolsOptionsSubCategory name="JavaScript Specific">
    4.94 +        <PropertyValue name="DownloadRemoteReferences">false</PropertyValue>
    4.95 +        <PropertyValue name="FormatCompletedBlockOnRightCurlyBrace">true</PropertyValue>
    4.96 +        <PropertyValue name="FormatCompletedLineOnEnter">true</PropertyValue>
    4.97 +        <PropertyValue name="FormatCompletedStatementOnSemicolon">true</PropertyValue>
    4.98 +        <PropertyValue name="FormatOnPaste">true</PropertyValue>
    4.99 +        <PropertyValue name="ImplicitReferencesString">Implicit (Windows)|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\libhelp.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\sitetypesWindows.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\domWindows.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\underscorefilter.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\showPlainComments.js;Implicit (Web)|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\libhelp.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\sitetypesWeb.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\domWeb.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\underscorefilter.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\showPlainComments.js|~/Scripts/_references.js;Dedicated Worker|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\libhelp.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\dedicatedworker.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\underscorefilter.js|C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References\showPlainComments.js;</PropertyValue>
   4.100 +        <PropertyValue name="InsertSpaceAfterCommaDelimiter">true</PropertyValue>
   4.101 +        <PropertyValue name="InsertSpaceAfterFunctionKeywordForAnonymousFunctions">true</PropertyValue>
   4.102 +        <PropertyValue name="InsertSpaceAfterKeywordsInControlFlowStatements">true</PropertyValue>
   4.103 +        <PropertyValue name="InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis">false</PropertyValue>
   4.104 +        <PropertyValue name="InsertSpaceAfterSemicolonInForStatements">true</PropertyValue>
   4.105 +        <PropertyValue name="InsertSpaceBeforeAndAfterBinaryOperators">true</PropertyValue>
   4.106 +        <PropertyValue name="PlaceOpenBraceOnNewLineForControlBlocks">false</PropertyValue>
   4.107 +        <PropertyValue name="PlaceOpenBraceOnNewLineForFunctions">false</PropertyValue>
   4.108 +        <PropertyValue name="ShowErrorsAsWarnings">true</PropertyValue>
   4.109 +        <PropertyValue name="ShowSyntaxErrors">true</PropertyValue>
   4.110 +      </ToolsOptionsSubCategory>
   4.111 +      <ToolsOptionsSubCategory name="C/C++ Specific">
   4.112 +        <PropertyValue name="AlwaysUseFallbackLocation">false</PropertyValue>
   4.113 +        <PropertyValue name="AutoIndentOnTab">false</PropertyValue>
   4.114 +        <PropertyValue name="ColorizeInactiveBlocksDifferently">true</PropertyValue>
   4.115 +        <PropertyValue name="DisableErrorReporting">false</PropertyValue>
   4.116 +        <PropertyValue name="EnumerateCommentTasks">true</PropertyValue>
   4.117 +        <PropertyValue name="HighlightMatchingTokens">true</PropertyValue>
   4.118 +        <PropertyValue name="IndentBraces">false</PropertyValue>
   4.119 +      </ToolsOptionsSubCategory>
   4.120 +    </ToolsOptionsCategory>
   4.121 +  </ToolsOptions>
   4.122 +</UserSettings>
   4.123 \ No newline at end of file
     5.1 --- a/RemoteControlSample.sln	Sun Dec 28 22:37:21 2014 +0100
     5.2 +++ b/RemoteControlSample.sln	Mon Dec 29 11:45:33 2014 +0100
     5.3 @@ -3,6 +3,11 @@
     5.4  # Visual Studio 2012
     5.5  Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteControlSample", "RemoteControlSample.csproj", "{F676C5E5-266C-439A-98C4-EF21CB9957F2}"
     5.6  EndProject
     5.7 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E70B5E73-7045-4EA7-968D-06BB68773DAB}"
     5.8 +	ProjectSection(SolutionItems) = preProject
     5.9 +		Rebracer.xml = Rebracer.xml
    5.10 +	EndProjectSection
    5.11 +EndProject
    5.12  Global
    5.13  	GlobalSection(SolutionConfigurationPlatforms) = preSolution
    5.14  		Debug|x86 = Debug|x86