11#include <unordered_set>
32 if (
binding.primaryInput != -1) {
35 <<
"' has overlapping keys for action: " <<
actionName <<
"\n";
43 if (
binding.alternateInput != -1) {
46 <<
"' has overlapping alternate key for action: " <<
actionName <<
"\n";
111 jump.primaryInput = 0;
116 shoot.primaryInput = 1;
125 SYSTEM_LOG <<
"[InputProfile][Info] Initialized default bindings for profile: " <<
profileName <<
"\n";
142 SYSTEM_LOG <<
"[InputDevice][Info] Assigned profile '" << profile->profileName
143 <<
"' to device: " <<
slot.deviceName <<
" (ID: " <<
slot.deviceIndex <<
")\n";
149 SYSTEM_LOG <<
"[InputDevice][Info] Device registered: " <<
slot.deviceName
151 <<
", ID: " <<
slot.deviceIndex <<
")\n";
159 SYSTEM_LOG <<
"[InputDevice][Info] Device unregistered: " <<
it->second.deviceName
160 <<
" (ID: " << deviceIndex <<
")\n";
164 if (
it->second.IsAssigned()) {
194 SYSTEM_LOG <<
"[InputDevice][Info] Auto-assigned "
204 SYSTEM_LOG <<
"[InputDevice][Warning] No available devices to assign to Player " <<
playerID <<
"\n";
213 SYSTEM_LOG <<
"[InputDevice][Error] Cannot assign device " << deviceIndex
214 <<
" to Player " <<
playerID <<
": device not found\n";
221 if (!
device.isConnected) {
223 SYSTEM_LOG <<
"[InputDevice][Error] Cannot assign device " << deviceIndex
224 <<
" to Player " <<
playerID <<
": device not connected\n";
231 SYSTEM_LOG <<
"[InputDevice][Warning] Device " << deviceIndex
233 <<
", reassigning to Player " <<
playerID <<
"\n";
242 SYSTEM_LOG <<
"[InputDevice][Info] Assigned device " << deviceIndex
243 <<
" (" <<
device.deviceName <<
") to Player " <<
playerID <<
"\n";
253 SYSTEM_LOG <<
"[InputDevice][Warning] Player " <<
playerID <<
" has no device assigned\n";
261 deviceIt->second.assignedPlayerID = -1;
267 SYSTEM_LOG <<
"[InputDevice][Info] Unassigned device from Player " <<
playerID <<
"\n";
299 if (
slot.IsAvailable()) {
307 std::vector<InputDeviceSlot*>
all;
318 SYSTEM_LOG <<
"[InputProfile][Info] Added profile: " << profile->profileName <<
"\n";
333 SYSTEM_LOG <<
"[InputProfile][Info] Set default profile for "
335 <<
": " << profileName <<
"\n";
343 <<
" (Priority: " <<
actionMap.priority <<
")\n";
349 if (
map.mapName == mapName) {
357 std::vector<ActionMap*>
maps;
359 if (
map.context == context) {
366 return a->priority > b->priority;
378 SYSTEM_LOG <<
"[InputDevice][Info] Log level set to: " <<
level <<
"\n";
382 SYSTEM_LOG <<
"[InputDevice][Info] === Device Status ===\n";
390 <<
", Connected: " << (
slot.isConnected ?
"Yes" :
"No")
391 <<
", Assigned: " << (
slot.IsAssigned() ?
"Player " + std::to_string(
slot.assignedPlayerID) :
"None")
392 <<
", Profile: " << (
slot.profile ?
slot.profile->profileName :
"None") <<
")\n";
395 SYSTEM_LOG <<
"[InputDevice][Info] ====================\n";
424 SYSTEM_LOG <<
"[InputContext][Info] Pushed context: "
435 SYSTEM_LOG <<
"[InputContext][Info] Popped context: "
441 SYSTEM_LOG <<
"[InputContext][Warning] Cannot pop context: stack has only one element\n";
454 SYSTEM_LOG <<
"[InputContext][Info] Editor mode " << (enabled ?
"enabled" :
"disabled") <<
"\n";
471 SYSTEM_LOG <<
"[InputContext][Info] Initialized with Gameplay context\n";
ComponentTypeID GetComponentTypeID_Static()
void PushContext(ActionMapContext ctx)
std::vector< ActionMapContext > m_contextStack
ActionMapContext GetActiveContext() const
void SetEditorEnabled(bool enabled)
void LoadConfig(const std::string &configPath)