3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/controls/ButtonHandleResult.h"
7#include "mc/client/gui/controls/UIComponent.h"
8#include "mc/client/gui/screens/ScreenEventScope.h"
9#include "mc/deps/input/InputMode.h"
10#include "mc/deps/input/enums/ButtonState.h"
11#include "mc/deps/input/enums/DirectionId.h"
31 enum class PressType :
int {
40 ::ll::TypedStorage<4, 4, uint> toButtonId;
41 ::ll::TypedStorage<1, 1, ::ScreenEventScope> scope;
49 ::ll::TypedStorage<4, 4, int> pressCount;
50 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> lastPressTime;
51 ::ll::TypedStorage<4, 8, ::glm::vec2> position;
58 ::ll::TypedStorage<8, 24, ::std::vector<::ScreenButtonMapping>> mButtonMappings;
59 ::ll::TypedStorage<8, 24, ::std::vector<::InputComponent::ScreenHoverButtonMapping>> mHoverButtonMappings;
60 ::ll::TypedStorage<1, 1, ::ScreenEventScope> mRemappingMappingScope;
61 ::ll::TypedStorage<1, 1, bool> mAlwaysHandlePointer;
62 ::ll::TypedStorage<1, 1, bool> mAlwaysHandleControllerDirection;
63 ::ll::TypedStorage<1, 1, bool> mHasRemappingMapping;
64 ::ll::TypedStorage<1, 1, bool> mAlwaysListensToInput;
65 ::ll::TypedStorage<1, 1, bool> mModal;
66 ::ll::TypedStorage<1, 1, bool> mInlineModal;
67 ::ll::TypedStorage<1, 1, bool> mIgnoreHoverChange;
68 ::ll::TypedStorage<1, 1, bool> mHoverEnabled;
69 ::ll::TypedStorage<1, 1, bool> mConsumeHoverEvents;
70 ::ll::TypedStorage<1, 1, bool> mPreventsTouchControl;
71 ::ll::TypedStorage<1, 1, bool> mGamepadDeflectionMode;
72 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint, ::InputComponent::PressStats>> mPressStats;
78 virtual ~InputComponent() =
default;
80 virtual ::std::unique_ptr<::UIComponent> clone(::UIControl& cloneOwner)
const ;
82 virtual void reset() ;
84 virtual void onVisibilityChanged(
bool visible) ;
90 MCAPI ::InputComponent::PressType
91 _detectDoubleClick(uint buttonId, ::ButtonState state, ::glm::vec2
const& pointerPosition,
bool isTTSTouchEnabled);
93 MCAPI
bool _getContentPanelHover(::glm::vec2
const& pointerPosition);
95 MCAPI
bool _sendButtonScreenEvent(
96 ::ScreenInputContext& context,
97 ::ScreenButtonMapping
const& buttonMapping,
99 ::glm::vec2
const& pointerPosition,
100 ::VisualTree& visualTree,
101 ::UIAnimationController& animationController,
102 ::InputMode inputMode
105 MCAPI
bool _sendHoverScreenEvent(
106 ::ScreenInputContext& context,
107 ::VisualTree& visualTree,
108 ::UIAnimationController& animationController,
109 ::glm::vec2
const& position,
113 MCAPI
bool _shouldHandleControllerDirection(::DirectionId directionId, ::glm::vec2
const& deltaPosition);
115 MCAPI
bool _shouldHandlePressedMapping(
116 ::ScreenButtonMapping
const& buttonMapping,
119 ::glm::vec2
const& pointerPosition,
120 ::InputMode inputMode
123 MCAPI ::ButtonHandleResult handleButtonEvent(
124 ::VisualTree& visualTree,
125 ::UIAnimationController& animationController,
126 ::ScreenInputContext& context,
129 ::glm::vec2
const& pointerPosition,
130 ::InputMode inputMode,
131 bool isTTSTouchEnabled
134 MCAPI
bool handleControllerDirection(
135 ::VisualTree& visualTree,
136 ::UIAnimationController& animationController,
137 ::ScreenInputContext& context,
138 ::DirectionId directionId,
139 ::glm::vec2
const& deltaPosition,
143 MCAPI
bool handleFocusLocation(
144 ::VisualTree& visualTree,
145 ::UIAnimationController& animationController,
146 ::ScreenInputContext& context,
147 ::glm::vec2
const& position,
151 MCAPI
bool handlePointerLocation(
152 ::VisualTree& visualTree,
153 ::UIAnimationController& animationController,
154 ::ScreenInputContext& context,
155 ::glm::vec2
const& position,
156 ::glm::vec2
const& deltaPosition,
160 MCAPI
bool isWithinClipRegion(::glm::vec2
const& pointerPosition)
const;
166 MCAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner)
const;
170 MCAPI
void $onVisibilityChanged(
bool visible);
Definition ScreenInputContext.h:5
Definition UIAnimationController.h:5
Definition UIComponent.h:5
Definition VisualTree.h:5