Skip to content

Commit 5cf3679

Browse files
committed
Stop checking press and scroll callbacks in idle handler
These are already covered by the newer player movement checks, and just confuse people due to the stacktraces
1 parent 12c3710 commit 5cf3679

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

platforms/common/src/main/java/dynamic_fps/impl/feature/state/IdleHandler.java

-33
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import org.jetbrains.annotations.Nullable;
1414
import org.lwjgl.glfw.GLFW;
1515
import org.lwjgl.glfw.GLFWCursorPosCallback;
16-
import org.lwjgl.glfw.GLFWKeyCallback;
17-
import org.lwjgl.glfw.GLFWMouseButtonCallback;
1816
import org.lwjgl.glfw.GLFWScrollCallback;
1917

2018
public class IdleHandler {
@@ -26,10 +24,8 @@ public class IdleHandler {
2624
private static Vec3 prevPosition = Vec3.ZERO;
2725
private static Vec3 prevLookAngle = Vec3.ZERO;
2826

29-
private static @Nullable GLFWKeyCallback previousKeyCallback;
3027
private static @Nullable GLFWScrollCallback previousScrollCallback;
3128
private static @Nullable GLFWCursorPosCallback previousCursorPosCallback;
32-
private static @Nullable GLFWMouseButtonCallback previousMouseClickCallback;
3329

3430
public static void init() {
3531
if (active) {
@@ -57,10 +53,7 @@ public static void init() {
5753

5854
public static void setWindow(long address) {
5955
if (active) {
60-
previousKeyCallback = GLFW.glfwSetKeyCallback(address, IdleHandler::onKey);
61-
previousScrollCallback = GLFW.glfwSetScrollCallback(address, IdleHandler::onScroll);
6256
previousCursorPosCallback = GLFW.glfwSetCursorPosCallback(address, IdleHandler::onMove);
63-
previousMouseClickCallback = GLFW.glfwSetMouseButtonCallback(address, IdleHandler::onPress);
6457
}
6558
}
6659

@@ -111,39 +104,13 @@ private static void checkPlayerActivity() {
111104
prevLookAngle = lookAngle;
112105
}
113106

114-
// Keyboard events
115-
116-
private static void onKey(long address, int key, int scancode, int action, int mods) {
117-
onActivity();
118-
119-
if (previousKeyCallback != null) {
120-
previousKeyCallback.invoke(address, key, scancode, action, mods);
121-
}
122-
}
123-
124107
// Mouse events
125108

126-
private static void onScroll(long address, double xOffset, double yOffset) {
127-
onActivity();
128-
129-
if (previousScrollCallback != null) {
130-
previousScrollCallback.invoke(address, xOffset, yOffset);
131-
}
132-
}
133-
134109
private static void onMove(long address, double x, double y) {
135110
onActivity();
136111

137112
if (previousCursorPosCallback != null) {
138113
previousCursorPosCallback.invoke(address, x, y);
139114
}
140115
}
141-
142-
private static void onPress(long address, int button, int action, int mods) {
143-
onActivity();
144-
145-
if (previousMouseClickCallback != null) {
146-
previousMouseClickCallback.invoke(address, button, action, mods);
147-
}
148-
}
149116
}

0 commit comments

Comments
 (0)