From 60b4d461469483cc0c08267f18e749b63466deef Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 6 Nov 2019 16:13:40 +0100 Subject: Added better cursor design --- src/kernel/input/ps2/mouse.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/kernel/input/ps2/mouse.c') diff --git a/src/kernel/input/ps2/mouse.c b/src/kernel/input/ps2/mouse.c index 0ee7b2b..015c1a5 100644 --- a/src/kernel/input/ps2/mouse.c +++ b/src/kernel/input/ps2/mouse.c @@ -29,6 +29,11 @@ void mouse_handler(struct regs *a_r) { mouse_but_2 = (mouse_byte[0] >> 1) & 1; mouse_but_3 = (mouse_byte[0] >> 2) & 1; mouse_cycle = 0; + + if (mouse_x < 0) mouse_x = 0; + if (mouse_y < 0) mouse_y = 0; + if (mouse_x > vbe_width - 1) mouse_x = vbe_width - 1; + if (mouse_y > vbe_height - 1) mouse_y = vbe_height - 1; vesa_draw_cursor(mouse_x, mouse_y); break; default: -- cgit v1.2.3