ReactOS  0.4.14-dev-115-g4576127
mouse.h
Go to the documentation of this file.
1 /*
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>
7  */
8 
9 #ifndef _MOUSE_H_
10 #define _MOUSE_H_
11 
12 /* DEFINES ********************************************************************/
13 
14 /* Mouse packet constants */
15 #define MOUSE_MAX 255
16 
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)
26 
27 /* Mouse packet extra flags */
28 #define MOUSE_4TH_BUTTON (1 << 4)
29 #define MOUSE_5TH_BUTTON (1 << 5)
30 
31 /* Command responses */
32 #define MOUSE_BAT_SUCCESS 0xAA
33 #define MOUSE_ACK 0xFA
34 #define MOUSE_ERROR 0xFC
35 
36 /*
37  * Scrolling directions
38  *
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.
42  */
43 #define MOUSE_SCROLL_UP 1
44 #define MOUSE_SCROLL_DOWN -1
45 #define MOUSE_SCROLL_RIGHT 2
46 #define MOUSE_SCROLL_LEFT -2
47 
48 typedef enum _MOUSE_MODE
49 {
54 
55 typedef struct _MOUSE_PACKET
56 {
62 
63 /* FUNCTIONS ******************************************************************/
64 
66 VOID MouseGetDataFast(PCOORD CurrentPosition, PBYTE CurrentButtonState);
67 BOOLEAN MouseInit(BYTE PS2Connector);
68 
69 #endif /* _MOUSE_H_ */
BYTE HorzCounter
Definition: mouse.h:58
struct _MOUSE_PACKET MOUSE_PACKET
VOID MouseGetDataFast(PCOORD CurrentPosition, PBYTE CurrentButtonState)
Definition: mouse.c:419
BYTE VertCounter
Definition: mouse.h:59
ULONG CurrentPosition
Definition: patchapi.h:57
unsigned char BOOLEAN
BYTE Extra
Definition: mouse.h:60
enum _MOUSE_MODE MOUSE_MODE
unsigned char BYTE
Definition: mem.h:68
Definition: bl.h:1338
VOID MouseEventHandler(PMOUSE_EVENT_RECORD MouseEvent)
Definition: mouse.c:427
_MOUSE_MODE
Definition: mouse.h:48
BYTE Flags
Definition: mouse.h:57
enum _MOUSE_MODE * PMOUSE_MODE
BOOLEAN MouseInit(BYTE PS2Connector)
Definition: mouse.c:464
BYTE * PBYTE
Definition: pedump.c:66
struct _MOUSE_PACKET * PMOUSE_PACKET