torcs - 1.2.2

Control Device Management


Detailed Description

This is the API to use control devices (Keyboard, mouse and joysticks).


Files

file  control.cpp
 Human control (joystick, mouse and keyboard).


Functions

tCtrlRefGfctrlGetRefByName (char *name)
 Get a control reference by its name.

char * GfctrlGetNameByRef (int type, int index)
 Get a control name by its reference.

tCtrlJoyInfoGfctrlJoyInit (void)
 Initialize the joystick control.

void GfctrlJoyRelease (tCtrlJoyInfo *joyInfo)
 Release the tCtrlJoyInfo structure.

int GfctrlJoyIsPresent (void)
 Check if a joystick is present.

int GfctrlJoyGetCurrent (tCtrlJoyInfo *joyInfo)
 Get the joystick current values.

tCtrlMouseInfoGfctrlMouseInit (void)
 Initialize the mouse control.

void GfctrlMouseRelease (tCtrlMouseInfo *mouseInfo)
 Release the tCtrlMouseInfo structure.

int GfctrlMouseGetCurrent (tCtrlMouseInfo *mouseInfo)
 Get the mouse current values.

void GfctrlMouseCenter (void)
 Recentre the mouse on the screen.

void GfctrlMouseInitCenter (void)
 Get the reference position.

void GfuiMouseSetHWPresent (void)
 Force the hardware mouse pointer.


Function Documentation

char* GfctrlGetNameByRef int  type,
int  index
 

Get a control name by its reference.

Parameters:
type type of control
index reference index
Returns:
pointer on a static structure tCtrlRef

tCtrlRef* GfctrlGetRefByName char *  name  ) 
 

Get a control reference by its name.

Parameters:
name name of the control
Returns:
pointer on a static structure tCtrlRef
See also:
tCtrlRef

int GfctrlJoyGetCurrent tCtrlJoyInfo joyInfo  ) 
 

Get the joystick current values.

Parameters:
joyInfo joystick structure
Returns:
0 ... Ok
-1 .. Error
Note:
The tCtrlJoyInfo structure is updated with the new values

Here is the call graph for this function:

tCtrlJoyInfo* GfctrlJoyInit void   ) 
 

Initialize the joystick control.

Returns:
pointer on a tCtrlJoyInfo structure
0 .. if no joystick present
Note:
call GfctrlJoyRelease to free the tCtrlJoyInfo structure
See also:
GfctrlJoyRelease

tCtrlJoyInfo

int GfctrlJoyIsPresent void   ) 
 

Check if a joystick is present.

Returns:
GFCTRL_JOY_NONE if no joystick
GFCTRL_JOY_PRESENT if a joystick is present

void GfctrlJoyRelease tCtrlJoyInfo joyInfo  ) 
 

Release the tCtrlJoyInfo structure.

Parameters:
joyInfo joystick structure
Returns:
none

void GfctrlMouseCenter void   ) 
 

Recentre the mouse on the screen.

Returns:
none

Here is the call graph for this function:

int GfctrlMouseGetCurrent tCtrlMouseInfo mouseInfo  ) 
 

Get the mouse current values.

Parameters:
mouseInfo mouse structure
Returns:
0 ... Ok
-1 .. Error
Note:
The tCtrlMouseInfo structure is updated with the new values

Here is the call graph for this function:

tCtrlMouseInfo* GfctrlMouseInit void   ) 
 

Initialize the mouse control.

Returns:
pointer on a tCtrlMouseInfo structure
0 .. if no mouse present
Note:
call GfctrlMouseRelease to free the tCtrlMouseInfo structure
See also:
GfctrlMouseRelease

void GfctrlMouseInitCenter void   ) 
 

Get the reference position.

Returns:
none

Here is the call graph for this function:

void GfctrlMouseRelease tCtrlMouseInfo mouseInfo  ) 
 

Release the tCtrlMouseInfo structure.

Parameters:
mouseInfo mouse structure
Returns:
none

void GfuiMouseSetHWPresent void   ) 
 

Force the hardware mouse pointer.

Returns:
0 ... Ok
-1 .. Error


Generated at Thu Feb 26 21:54:23 2004 for torcs by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-1999
TORCS © Eric Espié 1999, 2002.