Class TInputContext
java.lang.Object
io.github.thecsdev.tcdcommons.api.client.gui.util.TInputContext
Holds the information about a given user input.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
This refers to the current "phase" at which an input is being handled.
Each input phase has its own unique behaviors.static final class
Represents an input keyboard key.static enum
Represents an input's type.static @interface
Used to indicate whatTInputContext.InputType
a given getter method inTInputContext
is supposed to be used for. -
Method Summary
Modifier and TypeMethodDescriptionfinal TInputContext.InputType
final @Nullable TInputContext.InputKeyboardKey
final @Nullable Integer
final Point2D.Double
final Point2D.Double
final Point2D.Double
final @Nullable Character
static TInputContext
ofCharType
(char character, int modifiers) "Of character type"static TInputContext
ofKeyboardPR
(TInputContext.InputKeyboardKey key, boolean isDown) "Of keyboard press/release".static TInputContext
ofMouseCR
(int mouseButton, boolean isDown) "Of mouse click/release".static TInputContext
ofMouseDrag
(double mouseX, double mouseY, double deltaX, double deltaY, int mouseButton) "Of mouse drag"static TInputContext
ofMouseDragEnd
(int mouseButton) "Of mouse drag end"
Only invoked on elements that were previously being dragged and no longer are.static TInputContext
ofMouseMove
(double mouseX, double mouseY) static TInputContext
ofMouseScroll
(double mouseX, double mouseY, double vAmount) static TInputContext
ofMouseScroll
(double mouseX, double mouseY, double hAmount, double vAmount)
-
Method Details
-
getInputType
-
getKeyboardKey
-
getTypedChar
-
getMouseButton
-
getMousePosition
-
getMouseDelta
-
getScrollAmount
-
ofKeyboardPR
"Of keyboard press/release".- Parameters:
key
- TheTInputContext.InputKeyboardKey
that was pressed or released.isDown
- true =TInputContext.InputType.KEY_PRESS
; false =TInputContext.InputType.KEY_RELEASE
.
-
ofCharType
"Of character type"- Parameters:
character
- TheCharacter
the user typed.modifiers
- The character modifiers.
-
ofMouseCR
"Of mouse click/release".- Parameters:
mouseButton
- The mouse button that was clicked or released.isDown
- true =TInputContext.InputType.MOUSE_PRESS
; false =TInputContext.InputType.MOUSE_RELEASE
-
ofMouseMove
-
ofMouseDrag
public static TInputContext ofMouseDrag(double mouseX, double mouseY, double deltaX, double deltaY, int mouseButton) "Of mouse drag"- Parameters:
mouseButton
- The mouse button that was clicked when the dragging first started.
-
ofMouseDragEnd
"Of mouse drag end"
Only invoked on elements that were previously being dragged and no longer are.- Parameters:
mouseButton
- The mouse button that was clicked when the dragging first started.
-
ofMouseScroll
-
ofMouseScroll
public static TInputContext ofMouseScroll(double mouseX, double mouseY, double hAmount, double vAmount)
-