Adding colums to our listview.
2 using System.Windows.Forms;
3 using System.Runtime.InteropServices;
4 using System.Diagnostics;
6 using Microsoft.Win32.SafeHandles;
8 using System.Collections.Generic;
16 /// Our HID handler manages raw input registrations, processes WM_INPUT messages and broadcasts HID events in return.
18 public class HidHandler
20 public delegate void HidEventHandler(object aSender, HidEvent aHidEvent);
21 public event HidEventHandler OnHidEvent;
23 public bool IsRegistered { get; private set; }
25 public HidHandler(RAWINPUTDEVICE[] aRawInputDevices)
27 IsRegistered = Function.RegisterRawInputDevices(aRawInputDevices, (uint)aRawInputDevices.Length, (uint)Marshal.SizeOf(aRawInputDevices[0]));
31 public void ProcessInput(Message aMessage)
33 Hid.HidEvent hidEvent = new Hid.HidEvent(aMessage);
34 hidEvent.DebugWrite();
36 if (!hidEvent.IsValid || !hidEvent.IsGeneric)
38 Debug.WriteLine("Skipping HID message.");
42 //Broadcast our events
43 OnHidEvent(this, hidEvent);