Skip to content

Commit

Permalink
Call Input Callback
Browse files Browse the repository at this point in the history
  • Loading branch information
CADIndie committed Sep 10, 2024
1 parent a0e7830 commit 977fcbe
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
Binary file modified src/main/assets/lwjgl/lwjgl-glfw-classes.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/assets/lwjgl/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1725963866338
1725980855923
2 changes: 2 additions & 0 deletions src/main/java/pojlib/UnityPlayerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ protected String updateUnityCommandLineArguments(String cmdLine)
.remapLeftTrigger(true)
.remapRightTrigger(true)
.remapDpad(true));

CallbackBridge.nativeSetUseInputStackQueue(true);
}

public static DisplayMetrics getDisplayMetrics(Activity activity) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/pojlib/input/gamepad/Gamepad.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
public class Gamepad implements GrabListener, GamepadHandler {

/* Resolution scaler option, allow downsizing a window */
private final float mScaleFactor = 0; // LauncherPreferences.DEFAULT_PREF.getInt("resolutionRatio",100)/100f;
private final float mScaleFactor = 1; // LauncherPreferences.DEFAULT_PREF.getInt("resolutionRatio",100)/100f;

/* Sensitivity, adjusted according to screen size */
private final double mSensitivityFactor = (1.4 * (1080f/ currentDisplayMetrics.heightPixels));
Expand Down Expand Up @@ -79,7 +79,7 @@ public class Gamepad implements GrabListener, GamepadHandler {
private final GamepadDataProvider mMapProvider;

public Gamepad(InputDevice inputDevice, GamepadDataProvider mapProvider){
Settings.setDeadzoneScale(100f);
Settings.setDeadzoneScale(1f);

mScreenChoreographer = Choreographer.getInstance();
Choreographer.FrameCallback frameCallback = new Choreographer.FrameCallback() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/pojlib/input/gamepad/GamepadMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ public static GamepadMap getDefaultMenuMap(){
keycodes[0] = keycodes[1] = keycodes[2] = keycodes[3] = GamepadMap.MOUSE_SCROLL_DOWN;
}

menuMap.DPAD_DOWN.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_O; //For mods ?
menuMap.DPAD_UP.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_TAB; // QC Funnies
menuMap.DPAD_DOWN.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_ENTER; //For mods ?
menuMap.DPAD_RIGHT.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_K; //For mods ?
menuMap.DPAD_LEFT.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_J; //For mods ?

Expand Down
1 change: 1 addition & 0 deletions src/main/jni/input_bridge_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void pojavPumpEvents(void* window) {

while (targetIndex != index) {
GLFWInputEvent event = pojav_environ->events[index];
printf("event type: %i\n", event.type);
switch (event.type) {
case EVENT_TYPE_CHAR:
if(pojav_environ->GLFW_invoke_Char) pojav_environ->GLFW_invoke_Char(window, event.i1);
Expand Down

0 comments on commit 977fcbe

Please sign in to comment.