From d0b9a3df76fa2aca84ec3c885b3089b606bf0a4b Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Tue, 23 May 2023 21:15:15 +0100 Subject: [PATCH] Fix AltGr handling on windows It appears as mod=6, ctrl+alt codes shouldn't send the escape codes either. --- src/main/java/org/lwjglx/opengl/Display.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/lwjglx/opengl/Display.java b/src/main/java/org/lwjglx/opengl/Display.java index ff18eb0..28fa994 100644 --- a/src/main/java/org/lwjglx/opengl/Display.java +++ b/src/main/java/org/lwjglx/opengl/Display.java @@ -168,7 +168,7 @@ public class Display { 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