2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/hardware/mouse.h
5 * PURPOSE: PS/2 Mouse emulation
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
12 /* DEFINES ********************************************************************/
14 /* Mouse packet constants */
17 /* Mouse packet flags */
18 #define MOUSE_LEFT_BUTTON (1 << 0)
19 #define MOUSE_RIGHT_BUTTON (1 << 1)
20 #define MOUSE_MIDDLE_BUTTON (1 << 2)
21 #define MOUSE_ALWAYS_SET (1 << 3)
22 #define MOUSE_X_SIGN (1 << 4)
23 #define MOUSE_Y_SIGN (1 << 5)
24 #define MOUSE_X_OVERFLOW (1 << 6)
25 #define MOUSE_Y_OVERFLOW (1 << 7)
27 /* Mouse packet extra flags */
28 #define MOUSE_4TH_BUTTON (1 << 4)
29 #define MOUSE_5TH_BUTTON (1 << 5)
31 /* Command responses */
32 #define MOUSE_BAT_SUCCESS 0xAA
33 #define MOUSE_ACK 0xFA
34 #define MOUSE_ERROR 0xFC
37 * Scrolling directions
39 * It may seem odd that the directions are implemented this way, but
40 * this is how it's done on real hardware. It works because the two
41 * scroll wheels can't be used at the same time.
43 #define MOUSE_SCROLL_UP 1
44 #define MOUSE_SCROLL_DOWN -1
45 #define MOUSE_SCROLL_RIGHT 2
46 #define MOUSE_SCROLL_LEFT -2
48 typedef enum _MOUSE_MODE
53 } MOUSE_MODE
, *PMOUSE_MODE
;
55 typedef struct _MOUSE_PACKET
61 } MOUSE_PACKET
, *PMOUSE_PACKET
;
63 /* FUNCTIONS ******************************************************************/
65 VOID
MouseEventHandler(PMOUSE_EVENT_RECORD MouseEvent
);
66 VOID
MouseGetDataFast(PCOORD CurrentPosition
, PBYTE CurrentButtonState
);
67 BOOLEAN
MouseInit(BYTE PS2Connector
);
69 #endif /* _MOUSE_H_ */