forked from bartvdbraak/blender
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.
This commit is contained in:
parent
f0f3554e17
commit
a19229b80c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user