Class TInputContext
java.lang.Object
com.thecsdev.commonmc.api.client.gui.util.TInputContext
Holds information about a user's input.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThis refers to the current "phase" at which an input is being handled.
Each input phase has its own unique behaviors.static enumRepresents an input's type. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal @Nullable Characterfinal TInputContext.InputTypeReturns theTInputContext.InputType.final @Nullable Integerfinal @Nullable Integerfinal @Nullable Integerfinal @Nullable Doublefinal @Nullable Doublefinal @Nullable Doublefinal @Nullable Doublefinal @Nullable Integerfinal @Nullable Doublefinal @Nullable Doublefinal inthashCode()static final TInputContextofCharType(char character, int modifiers) Creates and returns aTInputContextforTInputContext.InputType.CHAR_TYPE.static final TInputContextofKeyPress(int keyCode, int scanCode, int modifiers) Creates and returns aTInputContextforTInputContext.InputType.KEY_PRESS.static final TInputContextofKeyRelease(int keyCode, int scanCode, int modifiers) Creates and returns aTInputContextforTInputContext.InputType.KEY_RELEASE.static final TInputContextofMouseDrag(double mouseX, double mouseY, int button, double deltaX, double deltaY) Creates and returns aTInputContextforTInputContext.InputType.MOUSE_DRAG.static final TInputContextofMouseMove(double mouseX, double mouseY) Creates and returns aTInputContextforTInputContext.InputType.MOUSE_RELEASE.static final TInputContextofMousePress(double mouseX, double mouseY, int button) Creates and returns aTInputContextforTInputContext.InputType.MOUSE_PRESS.static final TInputContextofMouseRelease(double mouseX, double mouseY, int button) Creates and returns aTInputContextforTInputContext.InputType.MOUSE_RELEASE.static final TInputContextofMouseScroll(double mouseX, double mouseY, double scrollX, double scrollY) Creates and returns aTInputContextforTInputContext.InputType.MOUSE_SCROLL.
-
Method Details
-
hashCode
-
equals
-
ofKeyPress
Creates and returns aTInputContextforTInputContext.InputType.KEY_PRESS.- Parameters:
keyCode- The key code.scanCode- The scan code.modifiers- The key modifiers.
-
ofKeyRelease
Creates and returns aTInputContextforTInputContext.InputType.KEY_RELEASE.- Parameters:
keyCode- The key code.scanCode- The scan code.modifiers- The key modifiers.
-
ofCharType
Creates and returns aTInputContextforTInputContext.InputType.CHAR_TYPE.- Parameters:
character- The typedCharacter.modifiers- The key modifiers.
-
ofMousePress
Creates and returns aTInputContextforTInputContext.InputType.MOUSE_PRESS.- Parameters:
mouseX- Mouse X position.mouseY- Mouse Y position.button- The pressed mouse button.
-
ofMouseRelease
Creates and returns aTInputContextforTInputContext.InputType.MOUSE_RELEASE.- Parameters:
mouseX- Mouse X position.mouseY- Mouse Y position.button- The pressed mouse button.
-
ofMouseMove
Creates and returns aTInputContextforTInputContext.InputType.MOUSE_RELEASE.- Parameters:
mouseX- Mouse X position.mouseY- Mouse Y position.
-
ofMouseScroll
public static final TInputContext ofMouseScroll(double mouseX, double mouseY, double scrollX, double scrollY) Creates and returns aTInputContextforTInputContext.InputType.MOUSE_SCROLL.- Parameters:
mouseX- Mouse X position.mouseY- Mouse Y position.scrollX- Horizontal scroll amount.scrollY- Vertical scroll amount.
-
ofMouseDrag
public static final TInputContext ofMouseDrag(double mouseX, double mouseY, int button, double deltaX, double deltaY) Creates and returns aTInputContextforTInputContext.InputType.MOUSE_DRAG.- Parameters:
mouseX- Mouse X position.mouseY- Mouse Y position.button- The pressed mouse button.deltaX- The mouse movement's delta X.deltaY- The mouse movement's delta Y.
-
getInputType
Returns theTInputContext.InputType. -
getKeyCode
- See Also:
-
getScanCode
- See Also:
-
getKeyModifiers
- See Also:
-
getCharacter
- See Also:
-
getMouseX
- See Also:
-
getMouseY
- See Also:
-
getMouseButton
- See Also:
-
getScrollX
- See Also:
-
getScrollY
- See Also:
-
getMouseDeltaX
- See Also:
-
getMouseDeltaY
- See Also:
-