Jump to content
  • Advertisement
Sign in to follow this  
Martin Perry

RawInput blocking input for other windows

This topic is 639 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

Shut down raw input when one of the GUI controls has focus.  Process input to these using regular windows messaging.

 

Startup raw input when your main window gets focus.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!