From 507b9c2768ed6dafff82460fbe743a48f6fa631a Mon Sep 17 00:00:00 2001 From: Torui <44932079+ToruiDev@users.noreply.github.com> Date: Sat, 26 Mar 2022 22:41:10 +0100 Subject: Trial/mouse buttons (#52) * try listening to mouse events too * add missing import --- src/main/java/de/torui/coflsky/EventRegistry.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/de/torui/coflsky/EventRegistry.java b/src/main/java/de/torui/coflsky/EventRegistry.java index 4b5186b..f8047e7 100644 --- a/src/main/java/de/torui/coflsky/EventRegistry.java +++ b/src/main/java/de/torui/coflsky/EventRegistry.java @@ -23,6 +23,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent; +import net.minecraftforge.fml.common.gameevent.InputEvent.MouseInputEvent; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientDisconnectionFromServerEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -40,6 +41,12 @@ public class EventRegistry { public long LastClick = System.currentTimeMillis(); + @SideOnly(Side.CLIENT) + @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) + public void onMouseEvent(MouseInputEvent event) { + onEvent(null); + } + @SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public void onEvent(KeyInputEvent event) { -- cgit