fix: controller mouse click simulation in screens

This commit is contained in:
Martin Prokoph
2025-10-02 00:13:40 +02:00
parent f2372cf406
commit c2cab16989
2 changed files with 2 additions and 2 deletions

View File

@@ -396,7 +396,7 @@ public class MidnightInput {
accessor.midnightcontrols$onCursorPos(client.getWindow().getHandle(), client.mouse.getX(), client.mouse.getY());
switch (storage.state) {
// Button pressed
case PRESS -> accessor.midnightcontrols$onMouseButton(client.getWindow().getHandle(), new MouseInput(GLFW_MOUSE_BUTTON_LEFT, 1), 0);
case PRESS -> accessor.midnightcontrols$onMouseButton(client.getWindow().getHandle(), new MouseInput(GLFW_MOUSE_BUTTON_LEFT, 0), 1);
case RELEASE -> { // Button released
accessor.midnightcontrols$onMouseButton(client.getWindow().getHandle(), new MouseInput(GLFW_MOUSE_BUTTON_LEFT, 0), 0);
client.currentScreen.setDragging(false);

View File

@@ -29,7 +29,7 @@ public class EmotecraftCompat {
InputManager.INPUT_MANAGER.updateMousePosition(client);
if (stickReleased) {
((MouseAccessor) client.mouse).midnightcontrols$onMouseButton(client.getWindow().getHandle(), new MouseInput(GLFW.GLFW_MOUSE_BUTTON_LEFT, GLFW.GLFW_PRESS), 0);
((MouseAccessor) client.mouse).midnightcontrols$onMouseButton(client.getWindow().getHandle(), new MouseInput(GLFW.GLFW_MOUSE_BUTTON_LEFT, 0), GLFW.GLFW_PRESS);
prevIndex = -1;
}
else prevIndex = index;