where the spaceball module located?

Questions and answers about 3Dconnexion devices on UNIX and Linux.

Moderator: Moderators

Post Reply
yfx2003
Posts: 6
Joined: Mon Jan 08, 2007 9:18 pm

where the spaceball module located?

Post by yfx2003 »

hi,

as x.org (http://www.x.org/wiki/Development/Docum ... InputHOWTO) said, "An X driver has to handle three different entities: modules, drivers and devices ".

but, when i installed my spaceball driver in redhat ws 4.0, I couldn't find the module and just a 3dxsrv driver located in /etc/3DxWare/daemon.

so, where is it? And, how to set my device in xorg.conf, as an input( or extension) device?


btw:

we develop a program with following codes:
--------------------------------------------------------------------------------------------
bool myfunc()
{
// get the list of input devices that are attached to the display now
XDeviceInfoPtr list;
int numDevices;

list = (XDeviceInfoPtr) XListInputDevices(display, &numDevices);

// now run through the list looking for the spaceball device
int i;
for (i = 0; (i < numDevices) && (strcmp(list.name, "spaceball") != 0); i++)
{
; // shut up and loop
cerr << "Devices' name: " << list.name << endl;

}
return (i < numDevices);
}
--------------------------------------------------------------------------------------------

the result is:
Devices' name: Keyboard0
Devices' name: Mouse0

Mine xorg.conf is:

Section "ServerLayout"
Identifier "single head configuration"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "spaceball"
EndSection

....

Section "InputDevice"
Identifier "spaceball"
Driver "/etc/3DxWare/daemon/3dxsrv"
Option "Name" "3dconnexion spaceball"
EndSection

######################################################
OS: redhat enterprise ws 4.0 (with cmd: uname -a
Linux YFX 2.6.9-34.EL #1 Fri Feb 24 16:44:51 EST 2006 i686 athlon i386 GNU/Linux)
X: X11R6
3dx driver: 3dxware-linux-v1-2-11.tgz
spaceball: spaceball 5000 FLX-A (serial)
######################################################

thank you very much.

yanfx
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

No Spaceball module

Post by UtaSH »

Hi yanfx,

our driver 3DxWareUnix is no X module, but more like an application. It is not suitable to be used with the xorg.conf.

There is no need to enter something in the xorg.conf. You just need to install it and that's it. The daemon (3dxsrv) reads the data from the device regardless of which of the supported models it is and sends it via XClientMessages to any application. You should have a look to our Unix/Linux SDK and check the code of the example (xapp.c).

Uta Ludwig
3Dconnexion
yfx2003
Posts: 6
Joined: Mon Jan 08, 2007 9:18 pm

SGI's Open Inventor may be failed with this way

Post by yfx2003 »

SGI's Open Inventor may be failed with this way
-----------------------------------------------------------------------------------------------

I do appreciate your timely help.

but, uludwig, you must know the 3d toolkit, SGI's Open Inventor. Their class SoXtSpaceball can support the spaceball. But now, as what you said, their support will be invalid??!!! The source code of this class are following:

Code: Select all

SoXtSpaceball::SoXtSpaceball(Display *d, SoXtSpaceball::Mask whichEvents)
{
    constructorCommon(d, whichEvents);
}
void
SoXtSpaceball::constructorCommon(
    Display *display,
    SoXtSpaceball::Mask whichEvents)
{
    eventMask = whichEvents;
    motionEvent = new SoMotion3Event;
    buttonEvent = new SoSpaceballButtonEvent;
    
    // these are empirically good default values
    rotScale = .006;
    transScale = .006;
    
    // get the list of input devices that are attached to the display now
    XDeviceInfoPtr  list;
    int		    numDevices;
    
    list = (XDeviceInfoPtr) XListInputDevices(display, &numDevices);
    
    // now run through the list looking for the spaceball device
    device = NULL;
    for (int i = 0; i < numDevices; i++) {
	// Open the spaceball device - the device id is set at runtime.
	if (strcmp(list[i].name, "spaceball") == 0) {
	    device = XOpenDevice(display, list[i].id);
	}
    }
   ......
}

SbBool
SoXtSpaceball::exists(Display *display)
{
    // get the list of input devices that are attached to the display now
    XDeviceInfoPtr  list;
    int		    numDevices;
    
    if (display == NULL) {
#ifdef DEBUG
	SoDebugError::post("SoXtSpaceball::exists()",
	    "display is NULL.\n");
#endif
	return FALSE;
    }
    
    list = (XDeviceInfoPtr) XListInputDevices(display, &numDevices);
    
    // now run through the list looking for the spaceball device
    int i;
    for (i = 0; (i < numDevices) &&
		    (strcmp(list[i].name, "spaceball") != 0); i++)
	; // shut up and loop

    // if we broke out of the loop before i reached numDevices,
    // then the spaceball does in fact exist. 
    return (i < numDevices);
}

and now, we build the org. demos (located in $IVROOT/apps/samples/spaceball), spaceball and spaceballViewer, they all tell me:

Code: Select all

Could not find a spaceball device connected to this display
because the source codes are:

Code: Select all

int
main(unsigned int, char *argv[])
{
    Widget mainWindow = SoXt::init(argv[0]);

    if (! SoXtSpaceball::exists()) {
	printf("Could not find a spaceball device connected to this display\n");
	exit(1);
    }
    ...
}
    
so, your spaceball will not support sgi's open inventor?!!

if not, how to get the string "spaceball" in our system (see my first post, please)?
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

No Support for Open Inventor

Post by UtaSH »

Hi yanfx,

yes, I have heard from Open Inventor from SGI. But as far as I know this application does not support our devices via the API provided by our driver. Long time ago there was support for some of the very old devices (Spaceball 2003 and 3003). This support did not use our driver and was not done by 3Dconnexion.

If you have a question about the source code of Open Inventor you should post them to Open Inventor. They are the right one to help you.

Uta
yfx2003
Posts: 6
Joined: Mon Jan 08, 2007 9:18 pm

what a pity

Post by yfx2003 »

as you said and we practise, the result is your driver lost sgi's open inventor. :(

now, we have to contract with tgs for their open inventor. (of course, others also can contact with coin3d.org for their toolkit.)


thanks for your reply. :lol:
Post Reply