[Previous]
[Contents]
[Next]

mouse_param()

set or query control parameters for a mouse

Synopsis:

#include <sys/mouse.h>
int mouse_param( struct _mouse_ctrl *mc,
                 int mode,
                 struct _mouse_param *param );

Description:

The mouse_param() function can be used to set or query the current control parameters for the mouse associated with mc.

The argument mc is the value returned by a previous mouse_open() call.

If mode is nonzero, mouse_param() sets the current parameters to be those given in param.

If mode is zero, then mouse_param() returns with the current mouse parameters in param.

The _mouse_param structure pointed to by param is defined in <sys/mouse.h>, and contains at least the following members:

Type Member Description
char name[] Symbolic name of this mouse (read only).
int threshold Threshold after which motions are scaled.
int gain Overall scale factor applied to all motions.

Returns:

0
Success
-1
An error occurred. errno is set to indicate the error.

Errors:

EINVAL
One of the arguments is invalid.
EOPNOTSUPP
The requested operation isn't supported.

Examples:

#include <sys/types.h>
#include <sys/mouse.h>
#include <stdio.h>

void main()
  {
    struct _mouse_ctrl *mc;
    struct _mouse_param param;

    mc = mouse_open( ( nid_t ) 0, 0, 0 );

    if( mouse_param( mc, 0, &param ) == 0 )
      printf( "Mouse is type %s\n", &param.name );
    else
      printf( "No mouse in use\n" );

    mouse_close( mc );
  }

Classification:

QNX

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

errno, mouse_close(), mouse_flush(), mouse_open(), mouse_read()


[Previous]
[Contents]
[Next]