mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 06:14:35 +00:00
Cleanup
This commit is contained in:
parent
9689f7b925
commit
a2867ff6ea
25
src/window.c
25
src/window.c
@ -40,28 +40,23 @@
|
|||||||
|
|
||||||
void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused)
|
void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused)
|
||||||
{
|
{
|
||||||
if (focused)
|
|
||||||
{
|
|
||||||
if (window->callbacks.focus)
|
|
||||||
window->callbacks.focus((GLFWwindow*) window, focused);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (window->callbacks.focus)
|
if (window->callbacks.focus)
|
||||||
window->callbacks.focus((GLFWwindow*) window, focused);
|
window->callbacks.focus((GLFWwindow*) window, focused);
|
||||||
|
|
||||||
for (i = 0; i <= GLFW_KEY_LAST; i++)
|
if (!focused)
|
||||||
{
|
{
|
||||||
if (window->keys[i] == GLFW_PRESS)
|
int key, button;
|
||||||
_glfwInputKey(window, i, 0, GLFW_RELEASE, 0);
|
|
||||||
|
for (key = 0; key <= GLFW_KEY_LAST; key++)
|
||||||
|
{
|
||||||
|
if (window->keys[key] == GLFW_PRESS)
|
||||||
|
_glfwInputKey(window, key, 0, GLFW_RELEASE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++)
|
for (button = 0; button <= GLFW_MOUSE_BUTTON_LAST; button++)
|
||||||
{
|
{
|
||||||
if (window->mouseButtons[i] == GLFW_PRESS)
|
if (window->mouseButtons[button] == GLFW_PRESS)
|
||||||
_glfwInputMouseClick(window, i, GLFW_RELEASE, 0);
|
_glfwInputMouseClick(window, button, GLFW_RELEASE, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user