I read article Using Raw Input from C# to handle multiple keyboards and download the source. It works when I run it in Windows 7, but failed when I run it in Windows 8.
I've got "Object reference not set to an instance of an object." error on
string deviceClass = (string)OurKey.GetValue("Class");
if (deviceClass.ToUpper().Equals("KEYBOARD"))
I placed breakpoint at string deviceClass and see the value is null. If you look at the downloaded source the value is obtained from the registry. Is there any difference between Windows 7 and Windows 8 to obtain this value? How do I solve this?