From a19229b80c18d74e24f418efdf526673b7cadb82 Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Sun, 8 Feb 2015 15:01:18 -0500 Subject: [PATCH] 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. --- intern/ghost/intern/GHOST_NDOFManagerX11.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/intern/ghost/intern/GHOST_NDOFManagerX11.cpp b/intern/ghost/intern/GHOST_NDOFManagerX11.cpp index 8e6f9994e51..c72485e9e1b 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;