MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / glfwGetKey

Function glfwGetKey

extern/glfw/src/input.c:629–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

627}
628
629GLFWAPI 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
652GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button)
653{

Callers 1

nk_glfw3_new_frameFunction · 0.85

Calls 1

_glfwInputErrorFunction · 0.85

Tested by

no test coverage detected