Class MouseHandler
java.lang.Object
net.minecraft.client.MouseHandler
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate doubleprivate @Nullable MouseButtonInfoprivate intstatic final longprivate intprivate booleanprivate booleanprivate booleanprivate booleanprivate @Nullable MouseHandler.LastClickprotected intprivate doubleprivate static final org.slf4j.Loggerprivate final Minecraftprivate booleanprivate doubleprivate final ScrollWheelHandlerprivate final SmoothDoubleprivate final SmoothDoubleprivate doubleprivate double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddrawDebugMouseInfo(Font font, GuiGraphics graphics) voidfillMousePositionDetails(CrashReportCategory category, Window window) doublegetScaledXPos(Window window) static doublegetScaledXPos(Window window, double x) doublegetScaledYPos(Window window) static doublegetScaledYPos(Window window, double y) doubledoublevoidvoidbooleanbooleanbooleanbooleanprivate voidonButton(long handle, MouseButtonInfo rawButtonInfo, int action) private voidprivate voidonMove(long handle, double xpos, double ypos) Will be called when the cursor is moved.private voidonScroll(long handle, double xoffset, double yoffset) Will be called when a scrolling device is used, such as a mouse wheel or scrolling area of a touchpad.voidvoidvoidprivate MouseButtonInfosimulateRightClick(MouseButtonInfo info, boolean pressed) private voidturnPlayer(double mousea) doublexpos()doubleypos()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
DOUBLE_CLICK_THRESHOLD_MS
public static final long DOUBLE_CLICK_THRESHOLD_MS- See Also:
-
minecraft
-
isLeftPressed
private boolean isLeftPressed -
isMiddlePressed
private boolean isMiddlePressed -
isRightPressed
private boolean isRightPressed -
xpos
private double xpos -
ypos
private double ypos -
lastClick
-
lastClickButton
protected int lastClickButton -
fakeRightMouse
private int fakeRightMouse -
activeButton
-
ignoreFirstMove
private boolean ignoreFirstMove -
clickDepth
private int clickDepth -
mousePressedTime
private double mousePressedTime -
smoothTurnX
-
smoothTurnY
-
accumulatedDX
private double accumulatedDX -
accumulatedDY
private double accumulatedDY -
scrollWheelHandler
-
lastHandleMovementTime
private double lastHandleMovementTime -
mouseGrabbed
private boolean mouseGrabbed
-
-
Constructor Details
-
MouseHandler
-
-
Method Details
-
onButton
-
simulateRightClick
-
fillMousePositionDetails
-
onScroll
private void onScroll(long handle, double xoffset, double yoffset) Will be called when a scrolling device is used, such as a mouse wheel or scrolling area of a touchpad.- See Also:
-
onDrop
-
setup
-
onMove
private void onMove(long handle, double xpos, double ypos) Will be called when the cursor is moved.The callback function receives the cursor position, measured in screen coordinates but relative to the top-left corner of the window client area. On platforms that provide it, the full sub-pixel cursor position is passed on.
- See Also:
-
handleAccumulatedMovement
public void handleAccumulatedMovement() -
getScaledXPos
-
getScaledXPos
-
getScaledYPos
-
getScaledYPos
-
turnPlayer
private void turnPlayer(double mousea) -
isLeftPressed
public boolean isLeftPressed() -
isMiddlePressed
public boolean isMiddlePressed() -
isRightPressed
public boolean isRightPressed() -
xpos
public double xpos() -
ypos
public double ypos() -
getXVelocity
public double getXVelocity() -
getYVelocity
public double getYVelocity() -
setIgnoreFirstMove
public void setIgnoreFirstMove() -
isMouseGrabbed
public boolean isMouseGrabbed() -
grabMouse
public void grabMouse() -
releaseMouse
public void releaseMouse() -
cursorEntered
public void cursorEntered() -
drawDebugMouseInfo
-