aboutsummaryrefslogtreecommitdiff
path: root/mousew16.h
blob: 42ecf04f2cb5bea0d604677c82133f630cc945da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef MOUSEW16_H
#define MOUSEW16_H

/* Win16's mouse driver interface. */

/** Contains information about the mouse, used by Inquire(). */
typedef _Packed struct MOUSEINFO
{
	/** Whether a mouse exists. */
	char    msExist;
	/** Whether the mouse returns absolute or relative coordinates. */
	char    msRelative;
	/** Number of buttons. */
	short   msNumButtons;
	/** Maximum number of events per second. */
	short   msRate;
	// Reserved:
	short   msXThreshold;
	short   msYThreshold;
	short   msXRes;
	short   msYRes;
	// The following are available in Windows >= 3.1 only:
	#if 0
	/** Specifies the COM port used, or 0 for none. */
	short   msMouseCommPort;
	#endif
} MOUSEINFO;
typedef MOUSEINFO __far *LPMOUSEINFO;

/** Status flag when posting mouse events to Windows (mouse_event func). */
enum MOUSESTATUSFLAGS {
	/** Movement occurred. */
	SF_MOVEMENT    = 0x0001,
	/** Button 1 changed to down. */
	SF_B1_DOWN     = 0x0002,
	/** Button 1 changed to up. */
	SF_B1_UP       = 0x0004,
	/** Button 2 changed to down. */
	SF_B2_DOWN     = 0x0008,
	/** Button 2 changed to up. */
	SF_B2_UP       = 0x0010,
	/** Event coordinates are absolute instead of relative. */
	SF_ABSOLUTE    = 0x8000,

	// The following may only work with win95 up.
	/** Button 3 changed to down. */
	SF_B3_DOWN     = 0x0020,
	/** Button 3 changed to up. */
	SF_B3_UP       = 0x0040,
};


/** Driver should call this callback when there are new mouse events to report.
 *  @param Status What happened. Combination of SF_MOVEMENT, SF_ABSOLUTE, etc.
 *  @param deltaX either number of mickeys moved or absolute coordinate if SB_ABSOLUTE.
 *  @param deltaY either number of mickeys moved or absolute coordinate if SB_ABSOLUTE.
 *  @param ButtonCount number of buttons
 *  @param extra1,extra2 leave as zero
 */
typedef void (__far *LPFN_MOUSEEVENT)(unsigned short Status, short deltaX, short deltaY, short ButtonCount, short extra1, short extra2);
#pragma aux MOUSEEVENTPROC parm [ax] [bx] [cx] [dx] [di] [si]

#endif