generic mouse interface

This commit is contained in:
Matheus
2023-01-05 23:29:03 -03:00
parent 2b4e97735b
commit b980ab94c2
5 changed files with 116 additions and 1 deletions
+1
View File
@@ -11,6 +11,7 @@
#define MAJOR_FB 5
#define MAJOR_KB 6
#define MAJOR_E9OUT 7
#define MAJOR_MOUSE 8
typedef struct{
int (*read)(int* error, int minor, void* buff, size_t count, size_t offset);
+28
View File
@@ -0,0 +1,28 @@
#ifndef _MOUSE_H_INCLUDE
#define _MOUSE_H_INCLUDE
#define MOUSE_FLAG_RB 1
#define MOUSE_FLAG_MB 2
#define MOUSE_FLAG_LB 4
#define MOUSE_FLAG_B4 8
#define MOUSE_FLAG_B5 16
#include <ringbuffer.h>
#include <kernel/event.h>
typedef struct {
int flags;
int x,y,z;
} mousepacket_t;
typedef struct {
ringbuffer_t buffer;
event_t event;
int flags;
} mouse_t;
void mouse_init();
int mouse_getnew();
void mouse_packet(int, mousepacket_t);
#endif