VR-Engage  2.2
Loading...
Searching...
No Matches
inputConfigViewer.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies, Inc.
3** All rights reserved.
4******************************************************************************/
5
6//! \file inputConfigViewer.h
7//! \brief ImGui-based input configuration viewer for VR-Engage debug menu
8
9#pragma once
10
11#include "vreInput/export.h"
13#include <string>
14#include <vector>
15#include <unordered_map>
16
17namespace makVre
18{
19 //! \brief Structure representing a mapped input action for display
21 {
22 std::string actionGroup;
23 std::string actionName;
24 std::string deviceType;
25 std::string deviceName;
26 std::string inputType;
27 std::string inputId;
28 std::vector<std::string> valueTransforms;
29 float currentValue = 0.0f;
30 bool isActive = false;
31 };
32
33 //! \brief Structure representing a device configuration for display
35 {
36 std::string deviceType;
37 std::string deviceName;
38 bool isConnected = false;
39 std::vector<DtInputActionDisplay> actions;
40 };
41
42 //! \brief ImGui-based input configuration viewer for the debug menu
44 {
45 public:
48 virtual bool initialize(DtVreInputManager* inputManager);
49 virtual void shutdown();
50 virtual void tick(double dt);
51 virtual void renderImGui();
52
53 private:
62 void renderDeviceConfig(const DtDeviceConfigDisplay& deviceConfig);
64 bool hasActionHandlers() const;
66
67 // Helper methods for real mapping discovery
68 size_t findDeviceIndexByKey(const std::string& deviceKey) const;
70 DtDeviceConfigDisplay& deviceConfig,
71 const std::string& layerInfo) const;
72 // Also add some helper methods for populating device actions
73 void addActionToCompatibleDevices(const std::string& actionGroup, const std::string& actionName);
74
75 // Helper method to convert input type enum to string
76 std::string inputTypeToString(int inputType) const;
77 private:
79 std::vector<DtDeviceConfigDisplay> myDeviceConfigs;
80
81 std::unordered_map<std::string, std::vector<DtInputActionDisplay*>> myActionMap;
82 char mySearchFilter[256];
85 static constexpr double REFRESH_INTERVAL = 1.0;
87 };
88
89} // namespace makVre
Maps device inputs to actions through evaluators.
Definition deviceMapping.h:32
bool passesFilter(const DtInputActionDisplay &action)
std::unordered_map< std::string, std::vector< DtInputActionDisplay * > > myActionMap
Definition inputConfigViewer.h:81
void addActionToCompatibleDevices(const std::string &actionGroup, const std::string &actionName)
double myLastRefreshTime
Definition inputConfigViewer.h:84
virtual bool initialize(DtVreInputManager *inputManager)
size_t findDeviceIndexByKey(const std::string &deviceKey) const
int mySelectedDeviceTab
Definition inputConfigViewer.h:86
void renderDeviceConfig(const DtDeviceConfigDisplay &deviceConfig)
DtVreInputManager * myInputManager
Definition inputConfigViewer.h:78
std::string inputTypeToString(int inputType) const
void extractActionsFromDeviceMapping(const DtDeviceMapping &mapping, DtDeviceConfigDisplay &deviceConfig, const std::string &layerInfo) const
std::vector< DtDeviceConfigDisplay > myDeviceConfigs
Definition inputConfigViewer.h:79
virtual void tick(double dt)
bool myShowInactiveInputs
Definition inputConfigViewer.h:83
static constexpr double REFRESH_INTERVAL
Definition inputConfigViewer.h:85
char mySearchFilter[256]
Definition inputConfigViewer.h:82
Central manager for input device handling, action mapping, and input processing.
Definition vreInputManager.h:81
Defines mapping between device inputs and actions.
Defines DLL export/import macros for the vreInput library.
#define VREINPUT_DLL
DLL export/import macro for the vreInput library.
Definition export.h:25
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
Structure representing a device configuration for display.
Definition inputConfigViewer.h:35
std::string deviceName
Definition inputConfigViewer.h:37
bool isConnected
Definition inputConfigViewer.h:38
std::string deviceType
Definition inputConfigViewer.h:36
std::vector< DtInputActionDisplay > actions
Definition inputConfigViewer.h:39
Structure representing a mapped input action for display.
Definition inputConfigViewer.h:21
std::string deviceType
Definition inputConfigViewer.h:24
std::string inputId
Definition inputConfigViewer.h:27
bool isActive
Definition inputConfigViewer.h:30
std::string inputType
Definition inputConfigViewer.h:26
std::string actionGroup
Definition inputConfigViewer.h:22
std::string deviceName
Definition inputConfigViewer.h:25
std::string actionName
Definition inputConfigViewer.h:23
std::vector< std::string > valueTransforms
Definition inputConfigViewer.h:28
float currentValue
Definition inputConfigViewer.h:29