SpaceControl DLL  Version 2.8.3
API documentation for the SpaceControl 3D input devices
Deprecated List
globalScope> Member scConnect ()
This function is replaced by scConnect2() and should not be used any longer.
Establishes the connection to the SpaceControl daemon. If this function is not executed successfully no other DLL functions can be used.
Example:
1 ScStatus status = scConnect();
2 if (status == SC_OK)
3  printf("connected\n");
4 else
5  printf("error\n");
Returns
SC_OK, SC_COMMUNICATION_ERROR
globalScope> Member scGetStdMode (int devIdx, unsigned char *bitmaskP)
Retrieves the operating mode for standard data.
globalScope> Member scSetState (char *str1, char *str2)
This function is replaced by scSetState2() and should not be used any longer.
Informs the daemon about the internal state (mode) of a supported application. The daemon will load the appropriate configuration file. See also scGetFgAppl().
Example:
1 char* str1 = "ProEngineer"; // the application's name as known to the daemon
2 char* str2 = "Assembly"; // the mode the application is in
3 ScStatus status = scSetState(str1, str2);
4 if (status == SC_OK)
5  printf("success\n");
6 else
7  printf("this can not happen\n");
This function is also used to tell the daemon the name of the application when the parameter str2 is set to "initializing". In this case the parameter str1 is put into the list of communication partners, and the daemon can identify this application. If the daemon knows an application by name it will stop sending data to it when it is not in the foreground any longer. An application not known to the daemon will always receive data whether it is in the foreground or not.
So, if you don't want getting data into your application when in background: Figure out how the daemon will identify your application by starting the control panel and getting your application into the foreground. The control panel prints the identifier in the status bar besides the label "Active Application:"; say, it states "MyApplication". Insert a statement
status = scState("MyApplication", "initializing");
into your code after your scConnect(), and the daemon knows to send data to your application only when it is in the foreground.
New extension since version 2.0.0:
To avoid sending data to a second instance of the same application (which has the same application name) you will have to provide the daemon with the process id of each instance. Append it to the application name, separated by a semicolon. Example with process id 1234:
status = scState("MyApplication;1234", "initializing");
You have to retrieve your processe's id at runtime, of course. See the Win32 API function GetCurrentProcessId().
Sorry for this unhandy interface; as you can see it is cobbled together a little.
Parameters
str1name of the supported application
str2state (mode) the supported application is in
Returns
SC_OK, SC_PARAMETER_OUT_OF_RANGE, SC_COMMUNICATION_ERROR, SC_WRONG_DEVICE_INDEX, SC_APPL_NOT_FOUND, SC_WRONG_USER
globalScope> Member scSetStdMode (int devIdx, unsigned char *bitmaskP)
Sets and retrieves the operating mode for standard data. See scGetStdMode() for details. Example:
1 int devIdx = 0;
2 unsigned char test = 2; // set test to 00000010
3 unsigned char bitmask = 3; // 00000011 <=> trans. and rot. mode active
4 ScStatus status = scSetStdMode(devIdx, &bitmask);
5 if (status == SC_OK)
6 {
7  if (bitmask & test)
8  printf("translational mode is active\n");
9  else
10  printf("translational mode is not active\n");
11 }
12 else
13  printf("error\n");
Attention: This function is used for the old SpaceMouse protocol and not needed for the new SpaceControl protocol.
Parameters
devIdxthe index of the device to be requested
Return values
bitmaskPpointer to the bitmask which contains the answer
Returns
SC_OK, SC_COMMUNICATION_ERROR, SC_WRONG_DEVICE_INDEX, SC_PARAMETER_OUT_OF_RANGE
SC DLL

SpaceControl Copyright (c) SpaceControl GmbH, Am Technologiepark 10, D-82229 Seefeld
Generated by Doxygen