# HG changeset patch # User sl # Date 1415477031 -3600 # Node ID 6e4d62a4fed3d40ee41522eb7dfc089b46582953 # Parent ff7a8955f82dff6317028d0ff305c9d0997a3a93 Logs and rename. diff -r ff7a8955f82d -r 6e4d62a4fed3 RemoteControlDevice.cs --- a/RemoteControlDevice.cs Sat Nov 08 12:40:05 2014 +0100 +++ b/RemoteControlDevice.cs Sat Nov 08 21:03:51 2014 +0100 @@ -440,20 +440,20 @@ { Debug.WriteLine("WM_INPUT source device is HID."); //Get Usage Page and Usage - Debug.WriteLine("Usage Page: 0x" + deviceInfo.hid.usUsagePage.ToString("X4") + " Usage: 0x" + deviceInfo.hid.usUsage.ToString("X4")); + Debug.WriteLine("Usage Page: 0x" + deviceInfo.hid.usUsagePage.ToString("X4") + " Usage ID: 0x" + deviceInfo.hid.usUsage.ToString("X4")); // - HidUsageHandler handler=null; + HidUsageHandler usagePageHandler=null; //Make sure both usage page and usage are matching MCE remote //TODO: handle more that just MCE usage page. if (deviceInfo.hid.usUsagePage == (ushort)Hid.UsagePage.MceRemote || deviceInfo.hid.usUsage == (ushort)Hid.UsageId.MceRemoteUsage) { - handler = HidMceRemoteHandler; + usagePageHandler = HidMceRemoteHandler; } else if (deviceInfo.hid.usUsagePage == (ushort)Hid.UsagePage.Consumer || deviceInfo.hid.usUsage == (ushort)Hid.UsageId.ConsumerControl) { - handler = HidConsumerDeviceHandler; + usagePageHandler = HidConsumerDeviceHandler; } else { @@ -507,8 +507,10 @@ usage = (ushort)((hidInput[2] << 8) + hidInput[1]); } - // - handler(usage); + Debug.WriteLine("Usage: 0x" + usage.ToString("X4")); + + //Call on our Usage Page handler + usagePageHandler(usage); } }