[Bf-blender-cvs] [a19229b] master: ndof: detect new 3Dx devices on Linux

Mike Erwin noreply at git.blender.org
Sun Feb 8 21:01:45 CET 2015


Commit: a19229b80c18d74e24f418efdf526673b7cadb82
Author: Mike Erwin
Date:   Sun Feb 8 15:01:18 2015 -0500
Branches: master
https://developer.blender.org/rBa19229b80c18d74e24f418efdf526673b7cadb82

ndof: detect new 3Dx devices on Linux

Was filtering for Logitech's USB vendor ID. 3Dconnexion now uses their
own vendor ID for new products. Mac & Windows don't look for specific
vendors so they should be fine.

Also added a note to eventually make USE_FINISH_GLITCH_WORKAROUND
available on all platforms.

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

M	intern/ghost/intern/GHOST_NDOFManagerX11.cpp

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

diff --git a/intern/ghost/intern/GHOST_NDOFManagerX11.cpp b/intern/ghost/intern/GHOST_NDOFManagerX11.cpp
index 8e6f999..c72485e 100644
--- a/intern/ghost/intern/GHOST_NDOFManagerX11.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManagerX11.cpp
@@ -42,8 +42,8 @@ GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
 
 #define MAX_LINE_LENGTH 100
 
-		/* look for USB devices with Logitech's vendor ID */
-		FILE *command_output = popen("lsusb -d 046d:", "r");
+		/* look for USB devices with Logitech or 3Dconnexion's vendor ID */
+		FILE *command_output = popen("lsusb | grep '046d:\|256f:'", "r");
 		if (command_output) {
 			char line[MAX_LINE_LENGTH] = {0};
 			while (fgets(line, MAX_LINE_LENGTH, command_output)) {
@@ -81,11 +81,11 @@ bool GHOST_NDOFManagerX11::available()
  * this causes any proceeding event to have a very high 'dt' (time delta),
  * many seconds for eg, causing the view to jump.
  *
- * this workaround expect's continuous events, if we miss a motion event,
+ * this workaround expects continuous events, if we miss a motion event,
  * immediately send a dummy event with no motion to ensure the finished state is reached.
  */
 #define USE_FINISH_GLITCH_WORKAROUND
-
+/* TODO: make this available on all platforms */
 
 #ifdef USE_FINISH_GLITCH_WORKAROUND
 static bool motion_test_prev = false;




More information about the Bf-blender-cvs mailing list