| 627 | } |
| 628 | |
| 629 | GLFWAPI int glfwGetKey(GLFWwindow* handle, int key) |
| 630 | { |
| 631 | _GLFWwindow* window = (_GLFWwindow*) handle; |
| 632 | assert(window != NULL); |
| 633 | |
| 634 | _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_RELEASE); |
| 635 | |
| 636 | if (key < GLFW_KEY_SPACE || key > GLFW_KEY_LAST) |
| 637 | { |
| 638 | _glfwInputError(GLFW_INVALID_ENUM, "Invalid key %i", key); |
| 639 | return GLFW_RELEASE; |
| 640 | } |
| 641 | |
| 642 | if (window->keys[key] == _GLFW_STICK) |
| 643 | { |
| 644 | // Sticky mode: release key now |
| 645 | window->keys[key] = GLFW_RELEASE; |
| 646 | return GLFW_PRESS; |
| 647 | } |
| 648 | |
| 649 | return (int) window->keys[key]; |
| 650 | } |
| 651 | |
| 652 | GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button) |
| 653 | { |
no test coverage detected