aboutsummaryrefslogtreecommitdiff
path: root/w16mouse.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-03-29 01:15:53 +0200
committerJavier <dev.git@javispedro.com>2022-03-29 01:15:53 +0200
commita816d1a09b1045fb5c155ac73f3231fcf9d93180 (patch)
treec4e31e850b9f2afb36acd6119483cf350c33f596 /w16mouse.h
parent67ebca92621aef31ff97705013456e95e60f7fbe (diff)
downloadvbados-a816d1a09b1045fb5c155ac73f3231fcf9d93180.tar.gz
vbados-a816d1a09b1045fb5c155ac73f3231fcf9d93180.zip
initial import of DOS mouse driver
Diffstat (limited to 'w16mouse.h')
-rw-r--r--w16mouse.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/w16mouse.h b/w16mouse.h
new file mode 100644
index 0000000..54b262f
--- /dev/null
+++ b/w16mouse.h
@@ -0,0 +1,53 @@
+#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;
+
+/** Movement occurred. */
+#define SF_MOVEMENT 0x0001
+/** Button 1 changed to down. */
+#define SF_B1_DOWN 0x0002
+/** Button 1 changed to up. */
+#define SF_B1_UP 0x0004
+/** Button 2 changed to down. */
+#define SF_B2_DOWN 0x0008
+/** Button 2 changed to up. */
+#define SF_B2_UP 0x0010
+/** Event coordinates are absolute instead of relative. */
+#define SF_ABSOLUTE 0x8000
+
+/** 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