X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=sidebyside;f=protocol%2Fps2_mouse.h;h=27d9790d43f551053c76a74f371a7faa916f74e2;hb=a26af7ca07d01bad87642684e648b0ce6b9961b8;hp=4529ce113214ba85c4687849c11f59dc8b4aa42a;hpb=f4125707399d11a7d80587659c464b9bcddb8c56;p=max%2Ftmk_keyboard.git
diff --git a/protocol/ps2_mouse.h b/protocol/ps2_mouse.h
index 4529ce11..27d9790d 100644
--- a/protocol/ps2_mouse.h
+++ b/protocol/ps2_mouse.h
@@ -20,6 +20,16 @@ along with this program. If not, see .
#include
+#define PS2_MOUSE_READ_DATA 0xEB
+
+/*
+ * Data format:
+ * byte|7 6 5 4 3 2 1 0
+ * ----+--------------------------------------------------------------
+ * 0|Yovflw Xovflw Ysign Xsign 1 Middle Right Left
+ * 1| X movement(0-255)
+ * 2| Y movement(0-255)
+ */
#define PS2_MOUSE_BTN_MASK 0x07
#define PS2_MOUSE_BTN_LEFT 0
#define PS2_MOUSE_BTN_RIGHT 1
@@ -29,16 +39,28 @@ along with this program. If not, see .
#define PS2_MOUSE_X_OVFLW 6
#define PS2_MOUSE_Y_OVFLW 7
-bool ps2_mouse_enable;
-extern uint8_t ps2_mouse_x;
-extern uint8_t ps2_mouse_y;
-extern uint8_t ps2_mouse_btn;
-extern uint8_t ps2_mouse_error_count;
+
+/*
+ * Scroll by mouse move with pressing button
+ */
+/* mouse button to start scrolling; set 0 to disable scroll */
+#ifndef PS2_MOUSE_SCROLL_BTN_MASK
+#define PS2_MOUSE_SCROLL_BTN_MASK (1<