glfwSetWindowFocusCallback¶
This function sets the focus callback of the specified window, which is called when the window gains or loses input focus.
After the focus callback is called for a window that lost input focus, synthetic key and mouse button release events will be generated for all such that had been pressed. For more information, see glfwSetKeyCallback and glfwSetMouseButtonCallback.
Example:
glfwSetWindowFocusCallback($window, function($focused) {
echo "Window focus changed to: " . $focused . PHP_EOL;
});
- arguments
-
\GLFWwindow
$window
The window whose callback to set.callable
$callback
- returns
-
void