3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/deps/input/InputDeviceMapper.h"
8#include "mc/deps/input/InputMode.h"
9#include "mc/deps/input/enums/ButtonState.h"
10#include "mc/deps/input/enums/DirectionId.h"
40 ::ll::TypedStorage<4, 4, uint> id;
41 ::ll::TypedStorage<1, 1, ::ButtonState> currentState;
42 ::ll::TypedStorage<4, 4, float> triggerThreshold;
50 ::ll::TypedStorage<1, 1, ::DirectionId> id;
51 ::ll::TypedStorage<4, 4, int> xAxis;
52 ::ll::TypedStorage<4, 4, int> yAxis;
53 ::ll::TypedStorage<1, 1, bool> raiseTurnEvents;
61 ::ll::TypedStorage<4, 4, uint> nameId;
62 ::ll::TypedStorage<4, 4, float> repeatInterval;
70 ::ll::TypedStorage<8, 64, ::std::unordered_multimap<int, ::GameControllerMapper::ButtonAttributes>>
71 mGamePadButtonToButtonIdMap;
72 ::ll::TypedStorage<8, 64, ::std::unordered_multimap<int, ::GameControllerMapper::TriggerState>>
73 mTriggerToButtonIdMap;
74 ::ll::TypedStorage<8, 64, ::std::unordered_multimap<int, ::GameControllerMapper::DirectionAttributes>>
75 mStickToDirectionIdMap;
76 ::ll::TypedStorage<8, 64, ::std::unordered_multimap<int, uint>> mStickToButtonIdMap;
77 ::ll::TypedStorage<8, 64, ::std::unordered_multimap<::DirectionId, uint>> mStickDirectionToButtonIdMap;
78 ::ll::TypedStorage<8, 16, ::std::set<uint>> mExclusiveButtonIdSet;
79 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, ::GameControllerStickEvent>> mPreviousStickEvents;
80 ::ll::TypedStorage<1, 1, bool> mMappingChanged;
88 ::ll::TypedStorage<1, 1, bool> turnStickActive;
89 ::ll::TypedStorage<4, 8, ::glm::vec2> lastTurnStickPos;
90 ::ll::TypedStorage<4, 4, int> controllerId;
94 using GameControllerButtonId = int;
96 using GamePadTriggerId = int;
98 using GamePadStickId = int;
100 using GamePadButtonToButtonIdMap = ::std::unordered_multimap<int, ::GameControllerMapper::ButtonAttributes>;
102 using GamePadTriggerToButtonIdMap = ::std::unordered_multimap<int, ::GameControllerMapper::TriggerState>;
104 using GamePadStickToDirectionIdMap = ::std::unordered_multimap<int, ::GameControllerMapper::DirectionAttributes>;
106 using GamePadStickToButtonIdMap = ::std::unordered_multimap<int, uint>;
108 using GamePadStickDirectionToButtonIdMap = ::std::unordered_multimap<::DirectionId, uint>;
110 using GamePadExclusiveButtonIdSet = ::std::set<uint>;
112 using GamePadStickEvents = ::std::unordered_map<int, ::GameControllerStickEvent>;
117 ::ll::TypedStorage<8, 8, double> mLastTime;
118 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, double>> mLastTurnButtonTimeSeconds;
119 ::ll::TypedStorage<8, 24, ::std::vector<::GameControllerMapper::GamepadStickTurnData>> mStickTurnData;
120 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, ::GameControllerMapper::GameControllerMappingData>>
127 virtual void setMapping(
128 ::InputEventQueue& eventQueue,
129 ::BindingFactory
const& bindingFactory,
130 ::InputMapping
const& inputMapping,
134 virtual void clearMapping(
int controllerId) ;
137 ::InputEventQueue& eventQueue,
138 ::Bedrock::NotNullNonOwnerPtr<::ControllerIDtoClientMap>
const& map
141 virtual ::InputMode getInputMode() const ;
143 virtual
void changeControllerId(
int oldId,
int newId) ;
145 virtual ::std::vector<::std::weak_ptr<::IGameController>> _getGameControllers() = 0;
147 virtual ::GameControllerInputMapping const& getGameControllerMapping(::InputMapping const& inputMapping) = 0;
153 MCAPI GameControllerMapper();
155 MCAPI
void _enqueueButtonDownUpEvents(
156 ::InputEventQueue& eventQueue,
158 ::DirectionId direction
161 MCAPI
void _handleButtonEvent(
162 ::InputEventQueue& eventQueue,
163 ::GameControllerButtonEvent const& buttonEvent,
165 int alternateControllerId
169 _handleStickEvent(::InputEventQueue& eventQueue, ::GameControllerStickEvent const& stickEvent,
int controllerId);
181 MCAPI
void $setMapping(
182 ::InputEventQueue& eventQueue,
183 ::BindingFactory const& bindingFactory,
184 ::InputMapping const& inputMapping,
188 MCAPI
void $clearMapping(
int controllerId);
191 $tick(::InputEventQueue& eventQueue, ::Bedrock::NotNullNonOwnerPtr<::ControllerIDtoClientMap> const& map);
193 MCFOLD ::InputMode $getInputMode() const;
195 MCAPI
void $changeControllerId(
int oldId,
int newId);
Definition BindingFactory.h:5
Definition GameControllerMapper.h:5
static MCAPI void ** $vftable()
Definition IGameController.h:5
Definition ControllerIDtoClientMap.h:5
Definition GameControllerMapper.h:19
Definition GameControllerMapper.h:23
Definition GameControllerMapper.h:25
Definition GameControllerMapper.h:17
Definition GameControllerStickEvent.h:5