fixed bind bug

This commit is contained in:
cattyn
2025-05-02 19:53:56 +03:00
parent b7c4b13cc4
commit e83733e145
@@ -13,6 +13,7 @@ import static me.alpha432.oyvey.util.traits.Util.EVENT_BUS;
public class MixinKeyboard { public class MixinKeyboard {
@Inject(method = "onKey", at = @At("TAIL"), cancellable = true) @Inject(method = "onKey", at = @At("TAIL"), cancellable = true)
private void onKey(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) { private void onKey(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) {
if (action != 1) return;
KeyEvent event = new KeyEvent(key); KeyEvent event = new KeyEvent(key);
EVENT_BUS.post(event); EVENT_BUS.post(event);
if (event.isCancelled()) ci.cancel(); if (event.isCancelled()) ci.cancel();