RemoteControlDevice.cs
changeset 14 0d9f479cbbf7
parent 13 6e4d62a4fed3
child 15 2044181ade12
     1.1 --- a/RemoteControlDevice.cs	Sat Nov 08 21:03:51 2014 +0100
     1.2 +++ b/RemoteControlDevice.cs	Mon Nov 24 16:46:26 2014 +0100
     1.3 @@ -445,19 +445,20 @@
     1.4                      //
     1.5                      HidUsageHandler usagePageHandler=null;
     1.6  
     1.7 -                    //Make sure both usage page and usage are matching MCE remote
     1.8 -                    //TODO: handle more that just MCE usage page.
     1.9 -                    if (deviceInfo.hid.usUsagePage == (ushort)Hid.UsagePage.MceRemote || deviceInfo.hid.usUsage == (ushort)Hid.UsageId.MceRemoteUsage)
    1.10 +                    //Check if this an MCE remote HID message
    1.11 +                    if (deviceInfo.hid.usUsagePage == (ushort)Hid.UsagePage.MceRemote && deviceInfo.hid.usUsage == (ushort)Hid.UsageId.MceRemoteUsage)
    1.12                      {                        
    1.13                          usagePageHandler = HidMceRemoteHandler;
    1.14                      }
    1.15 -                    else if (deviceInfo.hid.usUsagePage == (ushort)Hid.UsagePage.Consumer || deviceInfo.hid.usUsage == (ushort)Hid.UsageId.ConsumerControl)
    1.16 +                    //Check if this is a consumer control HID message
    1.17 +                    else if (deviceInfo.hid.usUsagePage == (ushort)Hid.UsagePage.Consumer && deviceInfo.hid.usUsage == (ushort)Hid.UsageId.ConsumerControl)
    1.18                      {
    1.19                          usagePageHandler = HidConsumerDeviceHandler;
    1.20                      }
    1.21 +                    //Unknown HID message
    1.22                      else
    1.23                      {
    1.24 -                        Debug.WriteLine("Not MCE remote page and usage.");
    1.25 +                        Debug.WriteLine("Unknown HID message.");
    1.26                          return;
    1.27                      }
    1.28