diff --git a/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java b/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java index e60966e60..0b9006165 100644 --- a/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java +++ b/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java @@ -56,6 +56,17 @@ public class CallbackBridge { nativeSendCursorPos(mouseX, mouseY); } + /** + * Sends keycodes if keycode is populated. Used for in-game controls. + * Sends character if keychar is populated. Used for chat and text input. + * You can refer to glfwSetKeyCallback for the arguments. + * @param keycode LwjglGlfwKeycode + * @param keychar Literal char. Modifier keys does not affect this. + * @param scancode + * @param modifiers The action is one of The action is one of GLFW_PRESS, or GLFW_RELEASE. + * We don't have GLFW_REPEAT working. + * @param isDown If its being pressed down or not. 1 is true. + */ public static void sendKeycode(int keycode, char keychar, int scancode, int modifiers, boolean isDown) { // TODO CHECK: This may cause input issue, not receive input! if(keycode != 0) nativeSendKey(keycode,scancode,isDown ? 1 : 0, modifiers); @@ -82,6 +93,10 @@ public class CallbackBridge { CallbackBridge.sendKeycode(keyCode, keyChar, scancode, modifiers, status); } + public static void sendKeyPress(int keyCode, char keyChar, int modifiers, boolean status) { + sendKeyPress(keyCode, keyChar, 0, modifiers, status); + } + public static void sendKeyPress(int keyCode) { sendKeyPress(keyCode, CallbackBridge.getCurrentMods(), true); sendKeyPress(keyCode, CallbackBridge.getCurrentMods(), false);