3#include "IInputProvider.h"
5#include "Foundation/StringView.h"
7#include "Foundation/Platform/Keyboard.h"
8#include "Foundation/Platform/Gestures.h"
53 void addProvider(std::unique_ptr<IInputProvider> provider);
62 float getAxisValue(
const StringView & name)
const;
65 bool getActionState(
const StringView & name)
const;
85 void gainedFocus(
double timestamp_ms);
86 void lostFocus(
double timestamp_ms);
88 void triggerPointerPress(PointerType pointerType, PointerId pointerId, MouseButton button,
const glm::ivec2& position,
double timestamp_ms);
89 void triggerPointerRelease(PointerType pointerType, PointerId pointerId, MouseButton button,
const glm::ivec2& position,
double timestamp_ms);
90 void triggerPointerMove(PointerType pointerType, PointerId pointerId,
const glm::ivec2& position,
double timestamp_ms);
91 void triggerMouseWheel(int32_t deltaValue,
double timestamp_ms);
93 void triggerKeyDown(Key key,
double timestamp_ms);
94 void triggerKeyUp(Key key,
double timestamp_ms);
95 void triggerKeyChar(std::string ch,
double timestamp_ms);
103 void updateConnections();
105 void updateActions();
111 double checkTimeStamp(
double timestamp_ms);
113 void readInputConfig(
const StringView & path);
119 double prevTimeStamp = 0.0;
121 static constexpr size_t NoAxis =
static_cast<size_t>(-1);
122 static constexpr size_t NoButton =
static_cast<size_t>(-1);
124 static constexpr size_t ErrorAxis =
static_cast<size_t>(-2);
125 static constexpr size_t ErrorButton =
static_cast<size_t>(-2);
129 std::string axisName;
145 std::vector<SourceAxisMapping> inputs;
150 std::string actionName;
163 std::vector<SourceActionMapping> inputs;
166 std::vector<InputDeviceState> deviceStates;
168 std::unordered_map<size_t, InputAxisMapping> axisMappings;
169 std::unordered_map<size_t, InputActionMapping> actionMappings;
171 std::vector<std::unique_ptr<IInputProvider>> inputProviders;
173 std::vector<InputDeviceIdentifier> pendingDevices;
175 friend void inputInspector(
Context * context,
bool * show);
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Provides a weakly referenced view over the contents of a string.
Contains all Cogs related functionality.