X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=protocol%2Fps2_mouse.h;h=27d9790d43f551053c76a74f371a7faa916f74e2;hb=fa545c87f74833856761572ef631d20accc1d026;hp=4529ce113214ba85c4687849c11f59dc8b4aa42a;hpb=62d1ebb91c7b381ce3d88aad9ee0b03bea9fce26;p=tmk_firmware.git diff --git a/protocol/ps2_mouse.h b/protocol/ps2_mouse.h index 4529ce1..27d9790 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<