2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
5 * PURPOSE: Mouse emulation
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
12 /* INCLUDES *******************************************************************/
16 /* DEFINES ********************************************************************/
18 /* Mouse packet constants */
19 #define MOUSE_MIN -256
21 #define MOUSE_SIGN_BIT (1 << 8)
23 /* Mouse packet flags */
24 #define MOUSE_LEFT_BUTTON (1 << 0)
25 #define MOUSE_RIGHT_BUTTON (1 << 1)
26 #define MOUSE_MIDDLE_BUTTON (1 << 2)
27 #define MOUSE_ALWAYS_SET (1 << 3)
28 #define MOUSE_X_SIGN (1 << 4)
29 #define MOUSE_Y_SIGN (1 << 5)
30 #define MOUSE_X_OVERFLOW (1 << 6)
31 #define MOUSE_Y_OVERFLOW (1 << 7)
33 /* Mouse packet extra flags */
34 #define MOUSE_4TH_BUTTON (1 << 4)
35 #define MOUSE_5TH_BUTTON (1 << 5)
37 /* Command responses */
38 #define MOUSE_BAT_SUCCESS 0xAA
39 #define MOUSE_ACK 0xFA
40 #define MOUSE_ERROR 0xFC
43 * Scrolling directions
45 * It may seem odd that the directions are implemented this way, but
46 * this is how it's done on real hardware. It works because the two
47 * scroll wheels can't be used at the same time.
49 #define MOUSE_SCROLL_UP 1
50 #define MOUSE_SCROLL_DOWN -1
51 #define MOUSE_SCROLL_RIGHT 2
52 #define MOUSE_SCROLL_LEFT -2
54 typedef enum _MOUSE_MODE
59 } MOUSE_MODE
, *PMOUSE_MODE
;
61 typedef struct _MOUSE_PACKET
67 } MOUSE_PACKET
, *PMOUSE_PACKET
;
69 /* FUNCTIONS ******************************************************************/
71 VOID
MouseUpdatePosition(PCOORD NewPosition
);
72 VOID
MouseUpdateButtons(ULONG NewButtonState
);
73 VOID
MouseScroll(LONG Direction
);
74 COORD
MouseGetPosition(VOID
);
75 VOID
MouseCommand(BYTE Command
);
76 BOOLEAN
MouseInit(VOID
);