FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
ps2-mouse.h
Go to the documentation of this file.
1
11
12#include <basics.h>
13#include <stdbool.h>
14#include <hal.h>
15#include <debugger.h>
16#include <opengl/glbackend.h>
17#include <isr.h>
18#include <hal.h>
19
20#define PS2_left_button 0b00000001
21#define PS2_middle_button 0b00000100
22#define PS2_right_button 0b00000010
23#define PS2_x 0b00010000
24#define PS2_y 0b00100000
25#define PS2_x_overflow 0b01000000
26#define PS2_y_overflow 0b10000000
27
28#define MOUSE_BUTTON_LEFT PS2_left_button
29#define MOUSE_BUTTON_RIGHT PS2_right_button
30#define MOUSE_BUTTON_MIDDLE PS2_middle_button
31
32#define MOUSE_BUTTON_PRESS 1
33#define MOUSE_BUTTON_RELEASE 0
34
35extern const bool mouse_cursor[];
36
40typedef void(*MouseMovementHandler)(int64_t xRel, int64_t yRel);
41
45typedef void(*MouseButtonHandler)(uint8_t button, uint8_t action);
46
55
64
73
82
This is a basic header files with FrostWing specific short forms and basically a good for life header...
The headers files for E9 hack.
Header file for Hardware Abstraction Layer -> Source from GoGX OS.
Interrupts handler header.
void SetMouseMovementHandler(MouseMovementHandler handler)
Set the mouse movement handler function.
void process_mouse(InterruptFrame *frame)
Handles the mouse's.
ivec2 GetLastMousePosition()
Get the last mouse position.
void(* MouseMovementHandler)(int64_t xRel, int64_t yRel)
Type definition for mouse movement handler functions.
Definition ps2-mouse.h:40
void(* MouseButtonHandler)(uint8_t button, uint8_t action)
Type definition for mouse button handler functions.
Definition ps2-mouse.h:45
void SetMouseButtonHandler(MouseButtonHandler handler)
Set the mouse button handler function.
ivec2 GetMousePosition()
Get the mouse position.