22
33import net .irisshaders .imgui .ImGuiMC ;
44import net .minecraft .client .KeyboardHandler ;
5+ //? if >1.21.8 {
6+ /*import net.minecraft.client.input.CharacterEvent;
7+ import net.minecraft.client.input.KeyEvent;
8+ */ //?}
59import org .spongepowered .asm .mixin .Mixin ;
610import org .spongepowered .asm .mixin .injection .At ;
711import org .spongepowered .asm .mixin .injection .Inject ;
812import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
913
1014@ Mixin (KeyboardHandler .class )
1115public class KeyboardHandlingMixin {
16+ //? if >1.21.8 {
17+ /*@Inject(method = "keyPress", at = @At("HEAD"))
18+ private void imgui$keyPress(long window, int action, KeyEvent keyEvent, CallbackInfo ci) {
19+ ImGuiMC.getInstance().onKeyPress(window, keyEvent.key(), keyEvent.scancode(), action, keyEvent.modifiers());
20+ }
21+
22+ @Inject(method = "charTyped", at = @At("HEAD"))
23+ private void imgui$charTyped(long l, CharacterEvent characterEvent, CallbackInfo ci) {
24+ ImGuiMC.getInstance().onCharTyped(l, characterEvent.codepoint(), characterEvent.modifiers());
25+ }
26+ */ //?} else {
1227 @ Inject (method = "keyPress" , at = @ At ("HEAD" ))
1328 private void imgui$keyPress (long l , int i , int j , int k , int m , CallbackInfo ci ) {
1429 ImGuiMC .getInstance ().onKeyPress (l , i , j , k , m );
@@ -18,4 +33,5 @@ public class KeyboardHandlingMixin {
1833 private void imgui$charTyped (long l , int i , int j , CallbackInfo ci ) {
1934 ImGuiMC .getInstance ().onCharTyped (l , i , j );
2035 }
36+ //?}
2137}
0 commit comments