Package net.minecraft.client
Class MouseHandler
java.lang.Object
net.minecraft.client.MouseHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate doubleprivate MouseButtonInfoprivate intstatic final longprivate intprivate booleanprivate booleanprivate booleanprivate booleanprotected intprotected longprivate 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 guiGraphics) voidfillMousePositionDetails(CrashReportCategory category, Window window) doublegetScaledXPos(Window window) static doublegetScaledXPos(Window window, double xPos) doublegetScaledYPos(Window window) static doublegetScaledYPos(Window window, double yPos) doubledoublevoidvoidbooleanbooleanbooleanbooleanprivate voidonButton(long window, MouseButtonInfo buttonInfo, int action) private voidprivate voidonMove(long windowPointer, double xpos, double ypos) Will be called when the cursor is moved.private voidonScroll(long windowPointer, 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 buttonInfo, boolean isPressed) private voidturnPlayer(double movementTime) 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 -
lastClickTime
protected long lastClickTime -
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 windowPointer, 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 windowPointer, 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 movementTime) -
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
-