Class MouseHandlerMixin

java.lang.Object
de.luckymcdev.foundryengine.mixin.input.MouseHandlerMixin
All Implemented Interfaces:
EngineInterface<net.minecraft.client.MouseHandler>, EngineMouseHandler

public class MouseHandlerMixin extends Object implements EngineMouseHandler
Blocks game input while a docked window fully covers the game view (see ImGuiManager.shouldBlockInput()). Input that ImGui itself captures is already cancelled by ImGuiMC's input mixins.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    engine$onButton(long handle, net.minecraft.client.input.MouseButtonInfo buttonInfo, int action, org.spongepowered.asm.mixin.injection.callback.CallbackInfo ci)
    Cancels mouse button events while the dock blocks game input.
    void
    engine$onMove(long handle, double xpos, double ypos, org.spongepowered.asm.mixin.injection.callback.CallbackInfo ci)
    Cancels cursor move events while the dock blocks game input, resetting position off-screen so MC screen widgets don't receive hover/click events at the real cursor position.
    void
    engine$onScroll(long handle, double horizontal, double vertical, org.spongepowered.asm.mixin.injection.callback.CallbackInfo ci)
    Cancels scroll events while the dock blocks game input, or forwards to the in-world editor.
    void
    Resets internal mouse state and positions the cursor off-screen.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface EngineInterface

    engine$self
  • Constructor Details

    • MouseHandlerMixin

      public MouseHandlerMixin()
  • Method Details

    • engine$onButton

      public void engine$onButton(long handle, net.minecraft.client.input.MouseButtonInfo buttonInfo, int action, org.spongepowered.asm.mixin.injection.callback.CallbackInfo ci)
      Cancels mouse button events while the dock blocks game input.
      Specified by:
      engine$onButton in interface EngineMouseHandler
    • engine$onScroll

      public void engine$onScroll(long handle, double horizontal, double vertical, org.spongepowered.asm.mixin.injection.callback.CallbackInfo ci)
      Cancels scroll events while the dock blocks game input, or forwards to the in-world editor.
      Specified by:
      engine$onScroll in interface EngineMouseHandler
    • engine$onMove

      public void engine$onMove(long handle, double xpos, double ypos, org.spongepowered.asm.mixin.injection.callback.CallbackInfo ci)
      Cancels cursor move events while the dock blocks game input, resetting position off-screen so MC screen widgets don't receive hover/click events at the real cursor position.
      Specified by:
      engine$onMove in interface EngineMouseHandler
    • engine$resetMouse

      public void engine$resetMouse()
      Description copied from interface: EngineMouseHandler
      Resets internal mouse state and positions the cursor off-screen.
      Specified by:
      engine$resetMouse in interface EngineMouseHandler