(fix) bug report: 1182628175151370380

This commit is contained in:
kirillsaint 2024-01-19 02:12:37 +06:00
parent f040ea4356
commit 8ae19788e0
2 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,26 @@
package net.silentclient.client.mixin.mixins.lwjgl;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(targets = "org.lwjgl.opengl.WindowsDisplay")
public abstract class WindowsDisplayMixin {
@Inject(method = "doHandleMessage", at = @At("HEAD"), cancellable = true, remap = false)
private void doHandleMessage(long hwnd, int msg, long wParam, long lParam, long millis,
CallbackInfoReturnable<Long> callback) {
if (msg == 0x020B) {
if ((wParam >> 16) == 1L) {
handleMouseButton(3, 1, millis);
} else {
handleMouseButton(4, 1, millis);
}
callback.setReturnValue(1L);
}
}
@Shadow
protected abstract void handleMouseButton(int button, int state, long millis);
}

View File

@ -119,6 +119,7 @@
"mixins.WorldClientMixin", "mixins.WorldClientMixin",
"mixins.WorldInfoMixin", "mixins.WorldInfoMixin",
"mixins.WorldMixin", "mixins.WorldMixin",
"mixins.WorldRendererMixin" "mixins.WorldRendererMixin",
"mixins.lwjgl.WindowsDisplayMixin"
] ]
} }