From 7cb217ed4aa3b875de525a112cbe5e12a570b4f1 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 18 May 2014 21:28:11 +0200 Subject: [PATCH] Fixed plural forms on key/button arrays. --- src/input.c | 32 ++++++++++++++++---------------- src/internal.h | 4 ++-- src/win32_window.c | 4 ++-- src/window.c | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/input.c b/src/input.c index 84da9f1d..4aa6b23d 100644 --- a/src/input.c +++ b/src/input.c @@ -93,8 +93,8 @@ static void setStickyKeys(_GLFWwindow* window, int enabled) // Release all sticky keys for (i = 0; i <= GLFW_KEY_LAST; i++) { - if (window->key[i] == _GLFW_STICK) - window->key[i] = GLFW_RELEASE; + if (window->keys[i] == _GLFW_STICK) + window->keys[i] = GLFW_RELEASE; } } @@ -115,8 +115,8 @@ static void setStickyMouseButtons(_GLFWwindow* window, int enabled) // Release all sticky mouse buttons for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++) { - if (window->mouseButton[i] == _GLFW_STICK) - window->mouseButton[i] = GLFW_RELEASE; + if (window->mouseButtons[i] == _GLFW_STICK) + window->mouseButtons[i] = GLFW_RELEASE; } } @@ -134,16 +134,16 @@ void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int m { GLboolean repeated = GL_FALSE; - if (action == GLFW_RELEASE && window->key[key] == GLFW_RELEASE) + if (action == GLFW_RELEASE && window->keys[key] == GLFW_RELEASE) return; - if (action == GLFW_PRESS && window->key[key] == GLFW_PRESS) + if (action == GLFW_PRESS && window->keys[key] == GLFW_PRESS) repeated = GL_TRUE; if (action == GLFW_RELEASE && window->stickyKeys) - window->key[key] = _GLFW_STICK; + window->keys[key] = _GLFW_STICK; else - window->key[key] = (char) action; + window->keys[key] = (char) action; if (repeated) action = GLFW_REPEAT; @@ -175,9 +175,9 @@ void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods) // Register mouse button action if (action == GLFW_RELEASE && window->stickyMouseButtons) - window->mouseButton[button] = _GLFW_STICK; + window->mouseButtons[button] = _GLFW_STICK; else - window->mouseButton[button] = (char) action; + window->mouseButtons[button] = (char) action; if (window->callbacks.mouseButton) window->callbacks.mouseButton((GLFWwindow*) window, button, action, mods); @@ -282,14 +282,14 @@ GLFWAPI int glfwGetKey(GLFWwindow* handle, int key) return GLFW_RELEASE; } - if (window->key[key] == _GLFW_STICK) + if (window->keys[key] == _GLFW_STICK) { // Sticky mode: release key now - window->key[key] = GLFW_RELEASE; + window->keys[key] = GLFW_RELEASE; return GLFW_PRESS; } - return (int) window->key[key]; + return (int) window->keys[key]; } GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button) @@ -305,14 +305,14 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button) return GLFW_RELEASE; } - if (window->mouseButton[button] == _GLFW_STICK) + if (window->mouseButtons[button] == _GLFW_STICK) { // Sticky mode: release mouse button now - window->mouseButton[button] = GLFW_RELEASE; + window->mouseButtons[button] = GLFW_RELEASE; return GLFW_PRESS; } - return (int) window->mouseButton[button]; + return (int) window->mouseButtons[button]; } GLFWAPI void glfwGetCursorPos(GLFWwindow* handle, double* xpos, double* ypos) diff --git a/src/internal.h b/src/internal.h index 7ce894d1..f31f0c26 100644 --- a/src/internal.h +++ b/src/internal.h @@ -232,8 +232,8 @@ struct _GLFWwindow GLboolean stickyMouseButtons; double cursorPosX, cursorPosY; int cursorMode; - char mouseButton[GLFW_MOUSE_BUTTON_LAST + 1]; - char key[GLFW_KEY_LAST + 1]; + char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1]; + char keys[GLFW_KEY_LAST + 1]; // OpenGL extensions and context attributes struct { diff --git a/src/win32_window.c b/src/win32_window.c index 5c7c91a0..2818ed81 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1218,10 +1218,10 @@ void _glfwPlatformPollEvents(void) // See if this differs from our belief of what has happened // (we only have to check for lost key up events) - if (!lshiftDown && window->key[GLFW_KEY_LEFT_SHIFT] == 1) + if (!lshiftDown && window->keys[GLFW_KEY_LEFT_SHIFT] == 1) _glfwInputKey(window, GLFW_KEY_LEFT_SHIFT, 0, GLFW_RELEASE, mods); - if (!rshiftDown && window->key[GLFW_KEY_RIGHT_SHIFT] == 1) + if (!rshiftDown && window->keys[GLFW_KEY_RIGHT_SHIFT] == 1) _glfwInputKey(window, GLFW_KEY_RIGHT_SHIFT, 0, GLFW_RELEASE, mods); } diff --git a/src/window.c b/src/window.c index 6dcc4cd2..717dfb0e 100644 --- a/src/window.c +++ b/src/window.c @@ -57,14 +57,14 @@ void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused) // Release all pressed keyboard keys for (i = 0; i <= GLFW_KEY_LAST; i++) { - if (window->key[i] == GLFW_PRESS) + if (window->keys[i] == GLFW_PRESS) _glfwInputKey(window, i, 0, GLFW_RELEASE, 0); } // Release all pressed mouse buttons for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++) { - if (window->mouseButton[i] == GLFW_PRESS) + if (window->mouseButtons[i] == GLFW_PRESS) _glfwInputMouseClick(window, i, GLFW_RELEASE, 0); } }