From c08ced39ae86d645de4317fdb53c623990bc36f1 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 5 Dec 2019 21:37:10 +0100 Subject: Some mouse cursor improvements --- src/kernel/input/ps2/mouse.c | 55 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) (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 97ae256..cb7406f 100644 --- a/src/kernel/input/ps2/mouse.c +++ b/src/kernel/input/ps2/mouse.c @@ -84,15 +84,64 @@ void mouse_install() mouse_wait(1); outb(0x64, 0x20); mouse_wait(0); - status = (inb(0x60) | 2); + status = (inb(0x60) | 3); mouse_wait(1); outb(0x64, 0x60); mouse_wait(1); outb(0x60, status); - // Use default settings - mouse_write(0xF6); + // Enable mousewheel + mouse_write(0xF2); mouse_read(); + mouse_read(); + mouse_write(0xF3); + mouse_read(); + mouse_write(200); + mouse_read(); + mouse_write(0xF3); + mouse_read(); + mouse_write(100); + mouse_read(); + mouse_write(0xF3); + mouse_read(); + mouse_write(80); + mouse_read(); + mouse_write(0xF2); + mouse_read(); + status = mouse_read(); + if (status == 3) serial_write("Scrollwheel support!\n"); + + // Activate 4th and 5th mouse buttons + mouse_write(0xF2); + mouse_read(); + mouse_read(); + mouse_write(0xF3); + mouse_read(); + mouse_write(200); + mouse_read(); + mouse_write(0xF3); + mouse_read(); + mouse_write(200); + mouse_read(); + mouse_write(0xF3); + mouse_read(); + mouse_write(80); + mouse_read(); + mouse_write(0xF2); + mouse_read(); + status = mouse_read(); + if (status == 4) serial_write("4th and 5th mouse button support!\n"); + + /* TODO: Fix mouse laggyness + mouse_write(0xE8); + mouse_read(); + mouse_write(0x03); + mouse_read(); + + mouse_write(0xF3); + mouse_read(); + mouse_write(200); + mouse_read(); */ // Enable mouse mouse_write(0xF4); -- cgit v1.2.3