2018-02-11, 02:19 AM
Are there any examples of how to capture remote control commands so I can build my own custom NextPVR client?
I am working with this bit of code but I get nothing when
It runs without error but I get nothing in the WndProc override when I press remote buttons.
Really frustrating.
Jim Margarit
I am working with this bit of code but I get nothing when
Code:
public void RegisterRemote()
{
RAWINPUTDEVICE[] rid = new RAWINPUTDEVICE[4];
rid[0].usUsagePage = 0xFFBC; // adds HID remote control
rid[0].usUsage = 0x88;
rid[0].dwFlags = 0;
rid[0].hwndTarget = fForm.Handle;
rid[1].usUsagePage = 0x0C; // adds HID remote control
rid[1].usUsage = 0x01;
rid[1].dwFlags = RIDEV_INPUTSINK;
rid[1].hwndTarget = fForm.Handle;
rid[2].usUsagePage = 0x0C; // adds HID remote control
rid[2].usUsage = 0x80;
rid[2].dwFlags = RIDEV_INPUTSINK;
rid[2].hwndTarget = fForm.Handle;
//rid[0].usUsagePage = 0x01; // adds HID mouse with no legacy messages
//rid[0].usUsage = 0x02;
//rid[0].dwFlags = RIDEV_NOLEGACY;
rid[3].usUsagePage = 0x01; // adds HID keyboard with no legacy message
rid[3].usUsage = 0x06;
rid[3].dwFlags = RIDEV_NOLEGACY;
uint theSize = (uint)Marshal.SizeOf(rid[0]);
if (!RegisterRawInputDevices(rid, (uint)rid.Length, theSize))
throw new ApplicationException("Failed to register raw input devices.");
}
It runs without error but I get nothing in the WndProc override when I press remote buttons.
Really frustrating.
Jim Margarit