-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCallbackBridge.java
51 lines (39 loc) · 1.76 KB
/
CallbackBridge.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package org.lwjgl.glfw;
import java.util.*;
public class CallbackBridge {
public static final int CLIPBOARD_COPY = 2000;
public static final int CLIPBOARD_PASTE = 2001;
public static final int EVENT_TYPE_CHAR = 1000;
public static final int EVENT_TYPE_CHAR_MODS = 1001;
public static final int EVENT_TYPE_CURSOR_ENTER = 1002;
public static final int EVENT_TYPE_CURSOR_POS = 1003;
public static final int EVENT_TYPE_FRAMEBUFFER_SIZE = 1004;
public static final int EVENT_TYPE_KEY = 1005;
public static final int EVENT_TYPE_MOUSE_BUTTON = 1006;
public static final int EVENT_TYPE_SCROLL = 1007;
public static final int EVENT_TYPE_WINDOW_SIZE = 1008;
public static final int ANDROID_TYPE_GRAB_STATE = 0;
public static final boolean INPUT_DEBUG_ENABLED;
// TODO send grab state event to Android
static {
INPUT_DEBUG_ENABLED = Boolean.parseBoolean(System.getProperty("glfwstub.debugInput", "false"));
/*
if (isDebugEnabled) {
//try {
//debugEventStream = new PrintStream(new File(System.getProperty("user.dir"), "glfwstub_inputeventlog.txt"));
debugEventStream = System.out;
//} catch (FileNotFoundException e) {
// e.printStackTrace();
//}
}
//Quick and dirty: debul all key inputs to System.out
*/
}
public static void sendData(int type, String data) {
nativeSendData(false, type, data);
}
public static native void nativeSendData(boolean isAndroid, int type, String data);
public static native boolean nativeSetInputReady(boolean ready);
public static native String nativeClipboard(int action, byte[] copy);
public static native void nativeSetGrabbing(boolean grab);
}