mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 23:25:10 +01:00
fix: controller mouse click simulation in screens
This commit is contained in:
@@ -396,7 +396,7 @@ public class MidnightInput {
|
|||||||
accessor.midnightcontrols$onCursorPos(client.getWindow().getHandle(), client.mouse.getX(), client.mouse.getY());
|
accessor.midnightcontrols$onCursorPos(client.getWindow().getHandle(), client.mouse.getX(), client.mouse.getY());
|
||||||
switch (storage.state) {
|
switch (storage.state) {
|
||||||
// Button pressed
|
// 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
|
case RELEASE -> { // Button released
|
||||||
accessor.midnightcontrols$onMouseButton(client.getWindow().getHandle(), new MouseInput(GLFW_MOUSE_BUTTON_LEFT, 0), 0);
|
accessor.midnightcontrols$onMouseButton(client.getWindow().getHandle(), new MouseInput(GLFW_MOUSE_BUTTON_LEFT, 0), 0);
|
||||||
client.currentScreen.setDragging(false);
|
client.currentScreen.setDragging(false);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class EmotecraftCompat {
|
|||||||
InputManager.INPUT_MANAGER.updateMousePosition(client);
|
InputManager.INPUT_MANAGER.updateMousePosition(client);
|
||||||
|
|
||||||
if (stickReleased) {
|
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;
|
prevIndex = -1;
|
||||||
}
|
}
|
||||||
else prevIndex = index;
|
else prevIndex = index;
|
||||||
|
|||||||
Reference in New Issue
Block a user