FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
ps2-mouse.h File Reference
#include <basics.h>
#include <stdbool.h>
#include <hal.h>
#include <debugger.h>
#include <opengl/glbackend.h>
#include <isr.h>
Include dependency graph for ps2-mouse.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PS2_left_button   0b00000001
#define PS2_middle_button   0b00000100
#define PS2_right_button   0b00000010
#define PS2_x   0b00010000
#define PS2_y   0b00100000
#define PS2_x_overflow   0b01000000
#define PS2_y_overflow   0b10000000
#define MOUSE_BUTTON_LEFT   PS2_left_button
#define MOUSE_BUTTON_RIGHT   PS2_right_button
#define MOUSE_BUTTON_MIDDLE   PS2_middle_button
#define MOUSE_BUTTON_PRESS   1
#define MOUSE_BUTTON_RELEASE   0

Typedefs

typedef void(* MouseMovementHandler) (int64_t xRel, int64_t yRel)
 Type definition for mouse movement handler functions.
typedef void(* MouseButtonHandler) (uint8_t button, uint8_t action)
 Type definition for mouse button handler functions.

Functions

void SetMouseMovementHandler (MouseMovementHandler handler)
 Set the mouse movement handler function.
void SetMouseButtonHandler (MouseButtonHandler handler)
 Set the mouse button handler function.
ivec2 GetMousePosition ()
 Get the mouse position.
ivec2 GetLastMousePosition ()
 Get the last mouse position.
void process_mouse (InterruptFrame *frame)
 Handles the mouse's.

Variables

const bool mouse_cursor []

Detailed Description

Author
Pradosh (prado.nosp@m.shga.nosp@m.me@gm.nosp@m.ail..nosp@m.com)
Version
0.1
Date
2023-12-22

Definition in file ps2-mouse.h.

Macro Definition Documentation

◆ MOUSE_BUTTON_LEFT

#define MOUSE_BUTTON_LEFT   PS2_left_button

Definition at line 28 of file ps2-mouse.h.

◆ MOUSE_BUTTON_MIDDLE

#define MOUSE_BUTTON_MIDDLE   PS2_middle_button

Definition at line 30 of file ps2-mouse.h.

◆ MOUSE_BUTTON_PRESS

#define MOUSE_BUTTON_PRESS   1

Definition at line 32 of file ps2-mouse.h.

◆ MOUSE_BUTTON_RELEASE

#define MOUSE_BUTTON_RELEASE   0

Definition at line 33 of file ps2-mouse.h.

◆ MOUSE_BUTTON_RIGHT

#define MOUSE_BUTTON_RIGHT   PS2_right_button

Definition at line 29 of file ps2-mouse.h.

◆ PS2_left_button

#define PS2_left_button   0b00000001

Definition at line 20 of file ps2-mouse.h.

◆ PS2_middle_button

#define PS2_middle_button   0b00000100

Definition at line 21 of file ps2-mouse.h.

◆ PS2_right_button

#define PS2_right_button   0b00000010

Definition at line 22 of file ps2-mouse.h.

◆ PS2_x

#define PS2_x   0b00010000

Definition at line 23 of file ps2-mouse.h.

◆ PS2_x_overflow

#define PS2_x_overflow   0b01000000

Definition at line 25 of file ps2-mouse.h.

◆ PS2_y

#define PS2_y   0b00100000

Definition at line 24 of file ps2-mouse.h.

◆ PS2_y_overflow

#define PS2_y_overflow   0b10000000

Definition at line 26 of file ps2-mouse.h.

Typedef Documentation

◆ MouseButtonHandler

typedef void(* MouseButtonHandler) (uint8_t button, uint8_t action)

Type definition for mouse button handler functions.

Definition at line 45 of file ps2-mouse.h.

◆ MouseMovementHandler

typedef void(* MouseMovementHandler) (int64_t xRel, int64_t yRel)

Type definition for mouse movement handler functions.

Definition at line 40 of file ps2-mouse.h.

Function Documentation

◆ GetLastMousePosition()

ivec2 GetLastMousePosition ( )

Get the last mouse position.

Author
GAMINGNOOBdev (https://github.com/GAMINGNOOBdev)
Returns
The last mouse position

◆ GetMousePosition()

ivec2 GetMousePosition ( )

Get the mouse position.

Author
GAMINGNOOBdev (https://github.com/GAMINGNOOBdev)
Returns
The mouse position

◆ process_mouse()

void process_mouse ( InterruptFrame * frame)

Handles the mouse's.

Parameters
frame

◆ SetMouseButtonHandler()

void SetMouseButtonHandler ( MouseButtonHandler handler)

Set the mouse button handler function.

Author
GAMINGNOOBdev (https://github.com/GAMINGNOOBdev)
Parameters
handlerMouse button handler function

◆ SetMouseMovementHandler()

void SetMouseMovementHandler ( MouseMovementHandler handler)

Set the mouse movement handler function.

Author
GAMINGNOOBdev (https://github.com/GAMINGNOOBdev)
Parameters
handlerMouse movement handler function