diff options
author | Marvin Borner | 2019-11-06 16:13:40 +0100 |
---|---|---|
committer | Marvin Borner | 2019-11-06 16:13:40 +0100 |
commit | 60b4d461469483cc0c08267f18e749b63466deef (patch) | |
tree | 38e3bc945addd30a00d24de6f88312de51638372 /src/kernel/input/ps2 | |
parent | b8b094e45ecaa7876e02e5ada246ae13e57dfe07 (diff) |
Added better cursor design
Diffstat (limited to 'src/kernel/input/ps2')
-rw-r--r-- | src/kernel/input/ps2/mouse.c | 5 |
1 files changed, 5 insertions, 0 deletions
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: |