I've never worked with raw input before and I'm having trouble even getting to a situation where I can receive WM_INPUT messages. I've been reading the MSDN page on raw input (link) but I'm having trouble deciphering what I actually need to do.
Right now I have this code:
Which from what I have seen should work but RegisterRawInputDevices always returns false and calling GetLastError() returns an error code of 998 (ERROR_NOACCESS) meaning an Invalid access to memory location. I read that the error might have something to do with AntiVirus/Firewall software but disabling my firewall returned the same results.Code:RAWINPUTDEVICE rawInputDevices; rawInputDevices.hwndTarget = 0; rawInputDevices.usUsagePage = 0x01; rawInputDevices.usUsage = 0; rawInputDevices.dwFlags = RIDEV_PAGEONLY; RegisterRawInputDevices( rawInputDevices_, 1, sizeof(rawInputDevices) );
Any help would be greatly appreciated, thanks.
After working on this for about an hour I finally decided to seek some help. Then right after posting I saw my problem... instead of using the RID variable I just created I'm using a member variable which is still sticking around from other attempts.