From 52cf53d480aa8bbd3f334bd89e1a527cc2b06998 Mon Sep 17 00:00:00 2001 From: ghostflyby Date: Tue, 12 Sep 2023 11:23:09 +0800 Subject: [PATCH] Fix macOS cmd + not sending pressed --- src/main/java/org/lwjglx/opengl/Display.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/lwjglx/opengl/Display.java b/src/main/java/org/lwjglx/opengl/Display.java index d8190e8..799703d 100644 --- a/src/main/java/org/lwjglx/opengl/Display.java +++ b/src/main/java/org/lwjglx/opengl/Display.java @@ -169,7 +169,9 @@ 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 && (GLFW_MOD_ALT & mods) == 0) { // Handle ctrl + x/c/v. + if ((GLFW_MOD_SUPER & mods) != 0) { + Keyboard.addGlfwKeyEvent(window, key, scancode, action, mods, (char) key); + } else 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