From 54920e3e85f7962008a3e3132e2f62a56790a91c Mon Sep 17 00:00:00 2001 From: Seth Archambault Date: Sun, 8 Jul 2018 11:00:09 -0400 Subject: [PATCH 1/2] glfw - extra key support for GAMEPAD, minimum key is now 18 --- src/external/glfw/CMakeLists.txt | 6 +++--- src/external/glfw/include/GLFW/glfw3.h | 1 + src/external/glfw/src/input.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/external/glfw/CMakeLists.txt b/src/external/glfw/CMakeLists.txt index 0eb7e7ea0..606744d43 100644 --- a/src/external/glfw/CMakeLists.txt +++ b/src/external/glfw/CMakeLists.txt @@ -359,15 +359,15 @@ configure_file(src/glfw3.pc.in src/glfw3.pc @ONLY) add_subdirectory(src) if (GLFW_BUILD_EXAMPLES) - add_subdirectory(examples) + #add_subdirectory(examples) endif() if (GLFW_BUILD_TESTS) - add_subdirectory(tests) + #add_subdirectory(tests) endif() if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS) - add_subdirectory(docs) + #add_subdirectory(docs) endif() #-------------------------------------------------------------------- diff --git a/src/external/glfw/include/GLFW/glfw3.h b/src/external/glfw/include/GLFW/glfw3.h index 990fe3f7f..4a84371d9 100644 --- a/src/external/glfw/include/GLFW/glfw3.h +++ b/src/external/glfw/include/GLFW/glfw3.h @@ -480,6 +480,7 @@ extern "C" { #define GLFW_KEY_RIGHT_SUPER 347 #define GLFW_KEY_MENU 348 +#define GLFW_KEY_FIRST 19 #define GLFW_KEY_LAST GLFW_KEY_MENU /*! @} */ diff --git a/src/external/glfw/src/input.c b/src/external/glfw/src/input.c index b0bb3de47..91ddf0def 100644 --- a/src/external/glfw/src/input.c +++ b/src/external/glfw/src/input.c @@ -579,7 +579,7 @@ GLFWAPI int glfwGetKeyScancode(int key) { _GLFW_REQUIRE_INIT_OR_RETURN(-1); - if (key < GLFW_KEY_SPACE || key > GLFW_KEY_LAST) + if (key < GLFW_KEY_FIRST || key > GLFW_KEY_LAST) { _glfwInputError(GLFW_INVALID_ENUM, "Invalid key %i", key); return GLFW_RELEASE; @@ -595,7 +595,7 @@ GLFWAPI int glfwGetKey(GLFWwindow* handle, int key) _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_RELEASE); - if (key < GLFW_KEY_SPACE || key > GLFW_KEY_LAST) + if (key < GLFW_KEY_FIRST || key > GLFW_KEY_LAST) { _glfwInputError(GLFW_INVALID_ENUM, "Invalid key %i", key); return GLFW_RELEASE; From 20e1a751c7b9cd6f6b652b4dff34848039e5b5ff Mon Sep 17 00:00:00 2001 From: Seth Archambault Date: Sun, 8 Jul 2018 11:03:39 -0400 Subject: [PATCH 2/2] undo glfw cmakelists change --- src/external/glfw/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/external/glfw/CMakeLists.txt b/src/external/glfw/CMakeLists.txt index 606744d43..0eb7e7ea0 100644 --- a/src/external/glfw/CMakeLists.txt +++ b/src/external/glfw/CMakeLists.txt @@ -359,15 +359,15 @@ configure_file(src/glfw3.pc.in src/glfw3.pc @ONLY) add_subdirectory(src) if (GLFW_BUILD_EXAMPLES) - #add_subdirectory(examples) + add_subdirectory(examples) endif() if (GLFW_BUILD_TESTS) - #add_subdirectory(tests) + add_subdirectory(tests) endif() if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS) - #add_subdirectory(docs) + add_subdirectory(docs) endif() #--------------------------------------------------------------------