PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
Mouse Abstraction

Mouse driver abstraction. More...

Collaboration diagram for Mouse Abstraction:

Detailed Description

Mouse driver abstraction.

Mouse devices are exposed as /dev/mouse/[id] directories, containing the following files:

Data Structures

struct  mouse_t
 Mouse structure. More...
 

Macros

#define MOUSE_MAX_EVENT   32
 Maximum number of queued mouse events.
 

Functions

mouse_tmouse_new (const char *name)
 Allocate and initialize a mouse structure.
 
void mouse_free (mouse_t *mouse)
 Free and deinitialize a mouse structure.
 
void mouse_push (mouse_t *mouse, mouse_buttons_t buttons, int64_t deltaX, int64_t deltaY)
 Push a new mouse event to the mouse event queue.
 

Macro Definition Documentation

◆ MOUSE_MAX_EVENT

#define MOUSE_MAX_EVENT   32

Maximum number of queued mouse events.

Definition at line 24 of file mouse.h.

Function Documentation

◆ mouse_new()

mouse_t * mouse_new ( const char *  name)

Allocate and initialize a mouse structure.

Will make the mouse available under /dev/mouse/[id].

Parameters
nameDriver specified name of the mouse device.
Returns
On success, the new mouse structure. On failure, NULL and errno is set.

Definition at line 84 of file mouse.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouse_free()

void mouse_free ( mouse_t mouse)

Free and deinitialize a mouse structure.

Removes the mouse from /dev/mouse/[id].

Parameters
mousePointer to the mouse structure to free.

Definition at line 150 of file mouse.c.

Here is the caller graph for this function:

◆ mouse_push()

void mouse_push ( mouse_t mouse,
mouse_buttons_t  buttons,
int64_t  deltaX,
int64_t  deltaY 
)

Push a new mouse event to the mouse event queue.

The event will be made available to user space by reading the stream file.

Parameters
mousePointer to the mouse structure.
buttonsThe button state.
deltaXThe change in X position.
deltaYThe change in Y position.

Definition at line 158 of file mouse.c.

Here is the call graph for this function:
Here is the caller graph for this function: