mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 09:39:25 -04:00
Fix the key combinations not working
This commit is contained in:
parent
13b7ffc680
commit
cfd58c274b
@ -1 +1 @@
|
||||
20210115
|
||||
20210115:2
|
||||
|
@ -497,7 +497,7 @@ public class GLFW
|
||||
private static ArrayMap<Long, GLFWWindowProperties> mGLFWWindowMap;
|
||||
|
||||
public static boolean mGLFWIsGrabbing, mGLFWIsInputReady, mGLFWIsUseStackQueue = false;
|
||||
|
||||
public static final byte[] keyDownBuffer = new byte[316];
|
||||
private static final String PROP_WINDOW_WIDTH = "glfwstub.windowWidth";
|
||||
private static final String PROP_WINDOW_HEIGHT= "glfwstub.windowHeight";
|
||||
|
||||
@ -1090,6 +1090,7 @@ public class GLFW
|
||||
break;
|
||||
case CallbackBridge.EVENT_TYPE_KEY:
|
||||
if (mGLFWKeyCallback != null) {
|
||||
keyDownBuffer[dataArr[1]-32]=(byte)(int)dataArr[3];
|
||||
mGLFWKeyCallback.invoke(ptr, dataArr[1], dataArr[2], dataArr[3], dataArr[4]);
|
||||
}
|
||||
break;
|
||||
@ -1174,7 +1175,7 @@ public class GLFW
|
||||
}
|
||||
|
||||
public static int glfwGetKey(@NativeType("GLFWwindow *") long window, int key) {
|
||||
return 0;
|
||||
return keyDownBuffer[key-32];
|
||||
}
|
||||
|
||||
public static int glfwGetMouseButton(@NativeType("GLFWwindow *") long window, int button) {
|
||||
|
@ -49,7 +49,7 @@ public class GLFWInputImplementation implements InputImplementation {
|
||||
public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) {
|
||||
coord_buffer.put(0, grab? mouseX - mouseLastX: mouseX);
|
||||
coord_buffer.put(1, grab? mouseY - mouseLastY: mouseY);
|
||||
System.out.println("Poll Call: Buffer length="+buttons.capacity()+"; Pos="+buttons.position());
|
||||
//System.out.println("Poll Call: Buffer length="+buttons.capacity()+"; Pos="+buttons.position());
|
||||
buttons.rewind();
|
||||
buttons.put(mouse_buffer);
|
||||
mouseLastX = mouseX;
|
||||
|
Loading…
x
Reference in New Issue
Block a user