HID Usage Tables fixes.
authorsl
Sat, 06 Dec 2014 22:59:55 +0100
changeset 286af1cbb3beb4
parent 27 305d2ecd3b1a
child 29 7679a5ab194b
HID Usage Tables fixes.
HidUsageTables.cs
RemoteControlDevice.cs
     1.1 --- a/HidUsageTables.cs	Sat Dec 06 21:52:45 2014 +0100
     1.2 +++ b/HidUsageTables.cs	Sat Dec 06 22:59:55 2014 +0100
     1.3 @@ -12,12 +12,12 @@
     1.4      public enum UsagePage : ushort
     1.5      {
     1.6          Undefined = 0,
     1.7 -        GenericDesktopControl,
     1.8 -        SimulationControl,
     1.9 -        VirtualRealityControl,
    1.10 -        SportControl,
    1.11 -        GameControl,
    1.12 -        GenericDeviceControl,
    1.13 +        GenericDesktopControls,
    1.14 +        SimulationControls,
    1.15 +        VirtualRealityControls,
    1.16 +        SportControls,
    1.17 +        GameControls,
    1.18 +        GenericDeviceControls,
    1.19          Keyboard,
    1.20          LightEmittingDiode,
    1.21          Button,
    1.22 @@ -48,7 +48,7 @@
    1.23          TerraTecRemote = 0xffcc
    1.24      }
    1.25  
    1.26 -    public enum UsageIdGenericDesktop : ushort
    1.27 +    public enum UsageCollectionGenericDesktop : ushort
    1.28      {      
    1.29          Pointer = 0x01,
    1.30          Mouse = 0x02,
    1.31 @@ -61,7 +61,7 @@
    1.32          SystemControl = 0x80
    1.33      }
    1.34  
    1.35 -    public enum UsageIdConsumer : ushort
    1.36 +    public enum UsageCollectionConsumer : ushort
    1.37      {
    1.38          ConsumerControl = 0x01,
    1.39          NumericKeyPad = 0x02,
    1.40 @@ -69,7 +69,25 @@
    1.41          Microphone = 0x04,
    1.42          Headphone = 0x05,
    1.43          GraphicEqualizer = 0x06,
    1.44 +        FunctionButtons = 0x36,
    1.45          Selection = 0x80,
    1.46 +        MediaSelection = 0x0087,
    1.47 +        SelectDisc = 0x00BA,
    1.48 +        PlaybackSpeed = 0x00F1,
    1.49 +        Proximity = 0x0109,
    1.50 +        SpeakerSystem = 0x0160,
    1.51 +        ChannelLeft = 0x0161,
    1.52 +        ChannelRight = 0x0162,
    1.53 +        ChannelCenter = 0x0163,
    1.54 +        ChannelFront = 0x0164,
    1.55 +        ChannelCenterFront = 0x0165,
    1.56 +        ChannelSide = 0x0166,
    1.57 +        ChannelSurrond = 0x0167,
    1.58 +        ChannelLowFrequencyEnhancement = 0x0168,
    1.59 +        ChannelTop = 0x0169,
    1.60 +        ChannelUnknown = 0x016A,
    1.61 +        ApplicationLaunchButtons = 0x016A,
    1.62 +        GenericGuiApplicationControls = 0x0200,
    1.63      }
    1.64  
    1.65      
    1.66 @@ -270,7 +288,6 @@
    1.67              Null = 0x0000,           
    1.68              //           
    1.69              Channel = 0x0086,
    1.70 -            MediaSelection = 0x0087,
    1.71              MediaSelectComputer = 0x0088,
    1.72              MediaSelectTV = 0x0089,
    1.73              MediaSelectWWW = 0x008A,
    1.74 @@ -304,8 +321,7 @@
    1.75              ScanPreviousTrack = 0x00B6,
    1.76              Stop = 0x00B7,
    1.77              Eject = 0x00B8,
    1.78 -            RandomPlay = 0x00B9,
    1.79 -            SelectDisc = 0x00BA,
    1.80 +            RandomPlay = 0x00B9,            
    1.81              EnterDisc = 0x00BB,
    1.82              Repeat = 0x00BC,
    1.83              Tracking = 0x00BD,
    1.84 @@ -343,7 +359,7 @@
    1.85              VolumeDecrement = 0x00EA,
    1.86  
    1.87              //Generic GUI Application Controls
    1.88 -            GenericGUIApplicationControls = 0x0200,
    1.89 +            //GenericGUIApplicationControls = 0x0200,
    1.90              AppCtrlNew = 0x0201,
    1.91              AppCtrlOpen = 0x0202,
    1.92              AppCtrlClose = 0x0203,
     2.1 --- a/RemoteControlDevice.cs	Sat Dec 06 21:52:45 2014 +0100
     2.2 +++ b/RemoteControlDevice.cs	Sat Dec 06 22:59:55 2014 +0100
     2.3 @@ -187,31 +187,31 @@
     2.4  
     2.5              i++;
     2.6              rid[i].usUsagePage = (ushort)Hid.UsagePage.Consumer;
     2.7 -            rid[i].usUsage = (ushort)Hid.UsageIdConsumer.ConsumerControl;
     2.8 +            rid[i].usUsage = (ushort)Hid.UsageCollectionConsumer.ConsumerControl;
     2.9              rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    2.10              rid[i].hwndTarget = aHWND;
    2.11  
    2.12              i++;
    2.13              rid[i].usUsagePage = (ushort)Hid.UsagePage.Consumer;
    2.14 -            rid[i].usUsage = (ushort)Hid.UsageIdConsumer.Selection;
    2.15 +            rid[i].usUsage = (ushort)Hid.UsageCollectionConsumer.Selection;
    2.16              rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    2.17              rid[i].hwndTarget = aHWND;
    2.18  
    2.19              i++;
    2.20 -            rid[i].usUsagePage = (ushort)Hid.UsagePage.GenericDesktopControl;
    2.21 -            rid[i].usUsage = (ushort)Hid.UsageIdGenericDesktop.SystemControl;
    2.22 +            rid[i].usUsagePage = (ushort)Hid.UsagePage.GenericDesktopControls;
    2.23 +            rid[i].usUsage = (ushort)Hid.UsageCollectionGenericDesktop.SystemControl;
    2.24              rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    2.25              rid[i].hwndTarget = aHWND;
    2.26  
    2.27              //i++;
    2.28 -            //rid[i].usUsagePage = (ushort)Hid.UsagePage.GenericDesktopControl;
    2.29 -            //rid[i].usUsage = (ushort)Hid.UsageIdGenericDesktop.Keyboard;
    2.30 +            //rid[i].usUsagePage = (ushort)Hid.UsagePage.GenericDesktopControls;
    2.31 +            //rid[i].usUsage = (ushort)Hid.UsageCollectionGenericDesktop.Keyboard;
    2.32              //rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    2.33              //rid[i].hwndTarget = aHWND;
    2.34  
    2.35              //i++;
    2.36 -            //rid[i].usUsagePage = (ushort)Hid.UsagePage.GenericDesktopControl;
    2.37 -            //rid[i].usUsage = (ushort)Hid.UsageIdGenericDesktop.Mouse;
    2.38 +            //rid[i].usUsagePage = (ushort)Hid.UsagePage.GenericDesktopControls;
    2.39 +            //rid[i].usUsage = (ushort)Hid.UsageCollectionGenericDesktop.Mouse;
    2.40              //rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    2.41              //rid[i].hwndTarget = aHWND;
    2.42  
    2.43 @@ -391,7 +391,7 @@
    2.44                  usagePageHandler = HidMceRemoteHandler;
    2.45              }
    2.46              //Check if this is a consumer control HID message
    2.47 -            else if (hidEvent.UsagePage == (ushort)Hid.UsagePage.Consumer && hidEvent.UsageCollection == (ushort)Hid.UsageIdConsumer.ConsumerControl)
    2.48 +            else if (hidEvent.UsagePage == (ushort)Hid.UsagePage.Consumer && hidEvent.UsageCollection == (ushort)Hid.UsageCollectionConsumer.ConsumerControl)
    2.49              {
    2.50                  usagePageHandler = HidConsumerDeviceHandler;
    2.51              }