DFBWindow Focus and Input Control

DBFWindows will get focus or keyboard input based on the window manager rerouting the input into the window, for example if the mouse moves over a window, it will receive the  message, and when the cursor leaves the window it will receive the.

If you want to control this further, here are some things good to know.

You could tell a specific window to always receive the mouse events using the IDirectFBWindow::GrabPointer interface. There's a corresponding IDirectFBWindow::UngrabPointer interface to release this relationship.

If you want to force all keyboard input to a specific window, use the IDirectFBWindow::GrabKeyboard interface, and to release this relationship, use the IDirectFBWindow::UngrabKeyboard interface. If you want specific keys to trigger the focus to a specific window, use the IDirectFBWindow::GrabKey interface, and to release the key, the IDirectFBWindow::UngrabKey interface.

You could force the specific focus to a window using the IDirectFBWindow::RequestsFocus interface.

If you want to create a window that is totally transparent to focus and input control, in other words will never receive focus or input events, then set the DFBWindowOptions flag called   using the IDirectFBWindow::SetOptions interface. For example the DFBCursor is using this technique.