Browse Source

Update GLFW, fix caps lock detection

pull/1639/head
Andrew Belt 7 years ago
parent
commit
f4fd102f4e
2 changed files with 4 additions and 2 deletions
  1. +1
    -1
      dep/glfw
  2. +3
    -1
      src/window.cpp

+ 1
- 1
dep/glfw

@@ -1 +1 @@
Subproject commit 682f1cf203707f21c2eed4fa3f89c23c52accc49
Subproject commit 617a322bd88c1b27f1fd7d05dc3723b6c5461a68

+ 3
- 1
src/window.cpp View File

@@ -264,7 +264,7 @@ void charCallback(GLFWwindow *window, unsigned int codepoint) {


void keyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) { void keyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) {
// Keyboard MIDI driver // Keyboard MIDI driver
if (glfwGetInputMode(gWindow, GLFW_LOCK_KEY_MODS) & GLFW_MOD_CAPS_LOCK) {
if (mods & GLFW_MOD_CAPS_LOCK) {
if (action == GLFW_PRESS) { if (action == GLFW_PRESS) {
keyboardPress(key); keyboardPress(key);
} }
@@ -355,6 +355,8 @@ void windowInit() {


glfwSwapInterval(1); glfwSwapInterval(1);


glfwSetInputMode(gWindow, GLFW_LOCK_KEY_MODS, 1);

glfwSetWindowSizeCallback(gWindow, windowSizeCallback); glfwSetWindowSizeCallback(gWindow, windowSizeCallback);
glfwSetMouseButtonCallback(gWindow, mouseButtonStickyCallback); glfwSetMouseButtonCallback(gWindow, mouseButtonStickyCallback);
// Call this ourselves, but on every frame instead of only when the mouse moves // Call this ourselves, but on every frame instead of only when the mouse moves


Loading…
Cancel
Save