Logs and rename.
1.1 --- a/RemoteControlDevice.cs Sat Nov 08 12:40:05 2014 +0100
1.2 +++ b/RemoteControlDevice.cs Sat Nov 08 21:03:51 2014 +0100
1.3 @@ -440,20 +440,20 @@
1.4 {
1.5 Debug.WriteLine("WM_INPUT source device is HID.");
1.6 //Get Usage Page and Usage
1.7 - Debug.WriteLine("Usage Page: 0x" + deviceInfo.hid.usUsagePage.ToString("X4") + " Usage: 0x" + deviceInfo.hid.usUsage.ToString("X4"));
1.8 + Debug.WriteLine("Usage Page: 0x" + deviceInfo.hid.usUsagePage.ToString("X4") + " Usage ID: 0x" + deviceInfo.hid.usUsage.ToString("X4"));
1.9
1.10 //
1.11 - HidUsageHandler handler=null;
1.12 + HidUsageHandler usagePageHandler=null;
1.13
1.14 //Make sure both usage page and usage are matching MCE remote
1.15 //TODO: handle more that just MCE usage page.
1.16 if (deviceInfo.hid.usUsagePage == (ushort)Hid.UsagePage.MceRemote || deviceInfo.hid.usUsage == (ushort)Hid.UsageId.MceRemoteUsage)
1.17 {
1.18 - handler = HidMceRemoteHandler;
1.19 + usagePageHandler = HidMceRemoteHandler;
1.20 }
1.21 else if (deviceInfo.hid.usUsagePage == (ushort)Hid.UsagePage.Consumer || deviceInfo.hid.usUsage == (ushort)Hid.UsageId.ConsumerControl)
1.22 {
1.23 - handler = HidConsumerDeviceHandler;
1.24 + usagePageHandler = HidConsumerDeviceHandler;
1.25 }
1.26 else
1.27 {
1.28 @@ -507,8 +507,10 @@
1.29 usage = (ushort)((hidInput[2] << 8) + hidInput[1]);
1.30 }
1.31
1.32 - //
1.33 - handler(usage);
1.34 + Debug.WriteLine("Usage: 0x" + usage.ToString("X4"));
1.35 +
1.36 + //Call on our Usage Page handler
1.37 + usagePageHandler(usage);
1.38 }
1.39
1.40 }