Skip to content

Commit

Permalink
Fix AltGr handling on windows
Browse files Browse the repository at this point in the history
It appears as mod=6, ctrl+alt codes shouldn't send the escape codes either.
  • Loading branch information
eigenraven committed May 23, 2023
1 parent 7da764c commit d0b9a3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/lwjglx/opengl/Display.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void invoke(long window, int key, int scancode, int action, int mods) {
cancelNextChar = false;
if (key > GLFW_KEY_SPACE && key <= GLFW_KEY_GRAVE_ACCENT) { // Handle keys have a char. Exclude space to
// avoid extra input when switching IME
if ((GLFW_MOD_CONTROL & mods) != 0) { // Handle ctrl + x/c/v.
if ((GLFW_MOD_CONTROL & mods) != 0 && (GLFW_MOD_ALT & mods) == 0) { // Handle ctrl + x/c/v.
Keyboard.addGlfwKeyEvent(window, key, scancode, action, mods, (char) (key & 0x1f));
cancelNextChar = true; // Cancel char event from ctrl key since its already handled here
} else if (action > 0) { // Delay press and repeat key event to actual char input. There is ALWAYS a
Expand Down

0 comments on commit d0b9a3d

Please sign in to comment.