|
PatchworkOS
966e257
A non-POSIX operating system.
|
Mouse driver abstraction. More...
Mouse driver abstraction.
Mouse devices are exposed as /dev/mouse/[id] directories, containing the following files:
events: A read-only pollable file that can be read to receive mouse events as mouse_event_t structs.name: A read-only file that contains the mouse driver specified name (e.g. "PS/2") Data Structures | |
| struct | mouse_t |
| Mouse structure. More... | |
Macros | |
| #define | MOUSE_MAX_EVENT 32 |
| Maximum number of queued mouse events. | |
Functions | |
| mouse_t * | mouse_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. | |
| #define MOUSE_MAX_EVENT 32 |
| mouse_t * mouse_new | ( | const char * | name | ) |
Allocate and initialize a mouse structure.
Will make the mouse available under /dev/mouse/[id].
| name | Driver specified name of the mouse device. |
NULL and errno is set. Definition at line 84 of file mouse.c.
| void mouse_free | ( | mouse_t * | mouse | ) |
| 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.
| mouse | Pointer to the mouse structure. |
| buttons | The button state. |
| deltaX | The change in X position. |
| deltaY | The change in Y position. |
Definition at line 158 of file mouse.c.