6#include <unordered_map>
95 Vector3f
rotate = { 0.0f, 0.0f, 0.0f };
122 const std::vector<std::vector<Buttons>>* buttonsMapPtr_ =
nullptr;
130 std::vector<std::vector<Buttons>> buttonMapCompact = {
144 std::vector<std::vector<Buttons>> buttonMapPro = {
154 std::vector<std::vector<Buttons>> buttonMapEnterprise = {
This class holds information and state of single SpaceMouse device.
Definition MRSpaceMouseDevice.h:100
void parseRawEvent(const DataPacketRaw &raw, int numBytes, Action &action) const
Parses data from raw packet to unified action
bool valid() const
Check if this device is set and valid.
void updateDevice(VendorId vId, ProductId pId)
Updates internal data by device ids (does nothing if ids is same for current device)
void resetDevice()
Invalidates this device and its state.
void processAction(const Action &action)
Definition MRSpaceMouseController.h:7
short unsigned int ProductId
Definition MRSpaceMouseDevice.h:13
Buttons
enumeration all spacemouse buttons
Definition MRSpaceMouseDevice.h:18
@ SMB_FIT
Definition MRSpaceMouseDevice.h:44
@ SMB_CUSTOM_9
Definition MRSpaceMouseDevice.h:39
@ SMB_LOCK_ROT
roll clockwise
Definition MRSpaceMouseDevice.h:49
@ SMB_BTN_V2
Definition MRSpaceMouseDevice.h:52
@ SMB_CUSTOM_10
Definition MRSpaceMouseDevice.h:40
@ SMB_TAB
Definition MRSpaceMouseDevice.h:24
@ SMB_DELETE
Definition MRSpaceMouseDevice.h:29
@ SMB_SPACE
Definition MRSpaceMouseDevice.h:28
@ SMB_RIGHT
Definition MRSpaceMouseDevice.h:46
@ SMB_CUSTOM_5
Definition MRSpaceMouseDevice.h:35
@ SMB_CUSTOM_8
Definition MRSpaceMouseDevice.h:38
@ SMB_CUSTOM_7
Definition MRSpaceMouseDevice.h:37
@ SMB_CUSTOM_12
Definition MRSpaceMouseDevice.h:42
@ SMB_BTN_V1
Definition MRSpaceMouseDevice.h:51
@ SMB_ALT
Definition MRSpaceMouseDevice.h:27
@ SMB_ISO1
Definition MRSpaceMouseDevice.h:54
@ SMB_CTRL
Definition MRSpaceMouseDevice.h:26
@ SMB_CUSTOM_1
Definition MRSpaceMouseDevice.h:31
@ SMB_CUSTOM_4
Definition MRSpaceMouseDevice.h:34
@ SMB_FRONT
Definition MRSpaceMouseDevice.h:47
@ SMB_NO
Definition MRSpaceMouseDevice.h:19
@ SMB_ROLL_CW
Definition MRSpaceMouseDevice.h:48
@ SMB_CUSTOM_6
Definition MRSpaceMouseDevice.h:36
@ SMB_BUTTON_COUNT
Definition MRSpaceMouseDevice.h:56
@ SMB_CUSTOM_11
Definition MRSpaceMouseDevice.h:41
@ SMB_MENU
Definition MRSpaceMouseDevice.h:20
@ SMB_TOP
Definition MRSpaceMouseDevice.h:45
@ SMB_BTN_V3
Definition MRSpaceMouseDevice.h:53
@ SMB_CUSTOM_3
Definition MRSpaceMouseDevice.h:33
@ SMB_SHIFT
Definition MRSpaceMouseDevice.h:25
@ SMB_ESC
Definition MRSpaceMouseDevice.h:22
@ SMB_ENTER
Definition MRSpaceMouseDevice.h:23
@ SMB_CUSTOM_2
Definition MRSpaceMouseDevice.h:32
short unsigned int VendorId
Definition MRSpaceMouseDevice.h:12
const std::unordered_map< VendorId, std::vector< ProductId > > cVendor2Device
Definition MRSpaceMouseDevice.h:61
std::array< unsigned char, 13 > DataPacketRaw
Definition MRSpaceMouseDevice.h:14
Definition MRSpaceMouseDevice.h:91
std::bitset< size_t(Buttons::SMB_BUTTON_COUNT)> buttons
Definition MRSpaceMouseDevice.h:93
Vector3f translate
Definition MRSpaceMouseDevice.h:94
Vector3f rotate
Definition MRSpaceMouseDevice.h:95
bool btnStateChanged
Definition MRSpaceMouseDevice.h:92