[Previous]
[Contents]
[Next]

mouse_open()

open a control channel to a mouse driver

Synopsis:

#include <sys/mouse.h>
struct _mouse_ctrl *mouse_open( nid_t nid,
                                char *name;
                                int fd );

Description:

The mouse_open() function opens up a control channel to the mouse driver. The returned pointer to a _mouse_ctrl structure can be used by subsequent calls to other mouse_... functions.

The (nid, name) pair identifies the registered name that has been attached by the mouse server. If ((nid_t) 0, NULL) is used, the default name of a local mouse server is assumed (that is, /dev/mouse).

In QNX 4.1 or later, the nid argument is ignored, and the name is used to identify both local and remote mice (for example, //2/dev/mouse).

The fd argument refers to an opened device that is associated with the mouse. This argument allows the mouse server to optionally track mouse interaction with a specific device (that is, current console). Usually, fd is 0 (that is, stdin).

An fd value of -1 opens the mouse for exclusive use, preventing other processes from opening the mouse. When opened for exclusive use, events from all consoles are generated.

Returns:

A pointer to a control structure that's used in subsequent calls to the other mouse_... functions. On error, a NULL is returned, and errno is set.

Errors:

EBADF
The argument fd is invalid.
EINVAL
One of the arguments is invalid.
ENOENT
Error trying to open the mouse pathname.
ENOMEM
Not enough memory to allocate a control structure.
ENOSYS
The device associated with name isn't a pointing device.

Examples:

See mouse_read().

Classification:

QNX

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

errno, mouse_close(), mouse_flush(), mouse_param(), mouse_read()


[Previous]
[Contents]
[Next]