Problems with raw input and window interaction with the RIDEV_NOLEGACY flag

I have a few questions related to using source input devices registered with the RIDEV_NOLEGACY flag.

  • when the window is inactivated, and I set the focus with a mouse click on the window, the focus is obtained, but the z-order of the window remains unchanged. (This does not happen during alt-tabbing)
  • impossible to interact with chrome window (resize, title bar buttons)

In my input class, I create a thread that only creates a message box and registers raw input devices. In another thread, I create a window that is used to render OpenGL.

Everything works fine until the legacy flag is specified. Perhaps this is just my ignorance of the Windows API. I tried working on the first problem with :: Set [Active, Foreground] Window hacks of inactivity. Is there a proper way to deal with these problems, or am I just unable to disable obsolete keyboard and mouse messages?

+4
source share
1 answer

When you sign up for raw input from a device, you get this raw data whether your window is front or background. Another way to express this: you get the initial input from the device for ALL application windows. Thus, if you prevent the creation of obsolete Windows messages using the RIDEV_NOLEGACY flag, you prevent the creation of obsolete Windows messages for ALL Windows operating systems. Most Windows applications rely on these legacy messages for proper operation. If your application is not a full-screen application, then RIDEV_NOLEGACY is not recommended.

+2
source

Source: https://habr.com/ru/post/1403298/


All Articles