diff -r 53886b25c49d -r b3e177062849 HidEvent.cs --- a/HidEvent.cs Mon Dec 22 12:46:22 2014 +0100 +++ b/HidEvent.cs Tue Dec 23 21:17:17 2014 +0100 @@ -13,7 +13,7 @@ /// /// Represent a HID event. /// - class HidEvent + public class HidEvent { public bool IsValid { get; private set; } public bool IsForeground { get; private set; } @@ -202,6 +202,30 @@ } + public ListViewItem ListViewItem + { + get + { + //TODO: What to do with multiple usage + string usage=""; + UsagePage usagePage=(UsagePage)UsagePage; + switch (usagePage) + { + case Hid.UsagePage.Consumer: + usage= ((Hid.UsageTables.ConsumerControl)Usages[0]).ToString(); + break; + + case Hid.UsagePage.WindowsMediaCenterRemoteControl: + usage= ((Hid.UsageTables.WindowsMediaCenterRemoteControl)Usages[0]).ToString(); + break; + + } + + ListViewItem item = new ListViewItem(new[] { usage, UsagePage.ToString("X2"), UsageCollection.ToString("X2") }); + return item; + } + } + }