Commit: c077f5fa0863796ce7e76772408306bcea90cde3
Author: Mike Erwin
Date:   Sat Dec 6 02:48:51 2014 -0500
Branches: master
https://developer.blender.org/rBc077f5fa0863796ce7e76772408306bcea90cde3

Fix T42789: support 3Dconnexion wireless devices

SpaceMouse Wireless
SpaceMouse Pro Wireless

Device info is from user reports. I don’t yet have the new devices, so
these are untested but likely to work :D

===================================================================

M       intern/ghost/intern/GHOST_NDOFManager.cpp
M       intern/ghost/intern/GHOST_NDOFManager.h

===================================================================

diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp 
b/intern/ghost/intern/GHOST_NDOFManager.cpp
index 9bd6226..86020e1 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManager.cpp
@@ -228,7 +228,7 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, 
unsigned short produ
        // that I don't have access to. Thanks!
 
        switch (vendor_id) {
-               case 0x046D: // Logitech (3Dconnexion)
+               case 0x046D: // Logitech (3Dconnexion was a subsidiary)
                        switch (product_id) {
                                // -- current devices --
                                case 0xC626: // full-size SpaceNavigator
@@ -281,6 +281,29 @@ bool GHOST_NDOFManager::setDevice(unsigned short 
vendor_id, unsigned short produ
                                        printf("ndof: unknown Logitech product 
%04hx\n", product_id);
                        }
                        break;
+               case 0x256F: // 3Dconnexion
+                       switch (product_id) {
+                               case 0xC62E: // plugged in
+                               case 0xC62F: // wireless
+                                       puts("ndof: using SpaceMouse Wireless");
+                                       m_deviceType = NDOF_SpaceMouseWireless;
+                                       m_buttonCount = 2;
+                                       m_hidMap = Modern3Dx_HID_map;
+                                       break;
+                               case 0xC631: // plugged in
+                               case 0xC632: // wireless
+                                       puts("ndof: using SpaceMouse Pro 
Wireless");
+                                       m_deviceType = 
NDOF_SpaceMouseProWireless;
+                                       m_buttonCount = 27;
+                                       // ^^ actually has 15 buttons, but 
their HID codes range from 0 to 26
+                                       m_buttonMask = 0x07C0F137;
+                                       m_hidMap = Modern3Dx_HID_map;
+                                       break;
+
+                               default:
+                                       printf("ndof: unknown 3Dconnexion 
product %04hx\n", product_id);
+            }
+            break;
                default:
                        printf("ndof: unknown device %04hx:%04hx\n", vendor_id, 
product_id);
        }
diff --git a/intern/ghost/intern/GHOST_NDOFManager.h 
b/intern/ghost/intern/GHOST_NDOFManager.h
index 0b2080e..8d6edf3 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.h
+++ b/intern/ghost/intern/GHOST_NDOFManager.h
@@ -38,6 +38,8 @@ typedef enum {
        NDOF_SpaceExplorer,
        NDOF_SpacePilotPro,
        NDOF_SpaceMousePro,
+       NDOF_SpaceMouseWireless,
+       NDOF_SpaceMouseProWireless,
 
        // older devices
        NDOF_SpacePilot,

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to