Sign in to follow this  

RawInput blocking input for other windows

Recommended Posts

In my C++ engine, I am using rawinput for keyboard controls. Now, I have added some external GUI with input text boxes. However, the inputs from keyborad are "eaten" by raw input and never passed to GUI, even if it has focus. If I focus other windows, like web browser, all is OK.

 

I register keyboard via this:

RAWINPUTDEVICE Rid[1];

Rid[0].usUsagePage = 0x01; 
Rid[0].usUsage = DEVICE_KEYBOARD; 
Rid[0].dwFlags = RIDEV_NOLEGACY; 
Rid[0].hwndTarget = windowHandle;

if (RegisterRawInputDevices(Rid, count, sizeof(Rid[0])) == FALSE){
MY_LOG_ERROR("Failed to register device");
}

and than check for WM_INPUT message

 

If I do not call RegisterRawInputDevices, GUI is working correctly, but the app obviously not, since I have not registered keyboard.

 

Is there a way to solve this?

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this