HariboteOS/day12/include/mouse.h
2021-03-25 23:28:49 +08:00

25 lines
460 B
C

#include "fifo.h"
#ifndef _MOUSE_H_
#define _MOUSE_H_
#define KEYCMD_SENDTO_MOUSE 0xd4
#define MOUSECMD_ENABLE 0xf4
#define MOUSE_FIFO_BUF_SIZE 128
struct MouseDec {
unsigned char buf[3], phase;
int x, y, btn;
};
extern struct FIFO8 mousefifo;
extern unsigned char mousebuf[MOUSE_FIFO_BUF_SIZE];
void enable_mouse(struct MouseDec *mdec);
int mouse_decode(struct MouseDec *mdec, unsigned char dat);
void int_handler27(int *esp);
#endif // _MOUSE_H_