summaryrefslogtreecommitdiffstats
path: root/matchblox/common/message_input.h
diff options
context:
space:
mode:
Diffstat (limited to 'matchblox/common/message_input.h')
-rw-r--r--matchblox/common/message_input.h106
1 files changed, 64 insertions, 42 deletions
diff --git a/matchblox/common/message_input.h b/matchblox/common/message_input.h
index e234b74..093d28e 100644
--- a/matchblox/common/message_input.h
+++ b/matchblox/common/message_input.h
@@ -1,44 +1,66 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
-#ifndef _CMESSAGE_INPUT_H
-#define _CMESSAGE_INPUT_H
-
-
-#define MESSAGE_INPUT_KEYBOARD 0x00001100
-#define MESSAGE_INPUT_MOUSE 0x00001200
-#define MESSAGE_INPUT_WIIMOTE 0x00001400
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <wiiuse.h>
-
-struct input_payload_keyboard
-{
- int specialkey;
- int key;
- int modifier;
- int x;
- int y;
-};
-
-struct input_payload_mouse
-{
- int passive;
- int button;
- int state;
- int x;
- int y;
-};
-
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
+#ifndef _CMESSAGE_INPUT_H
+#define _CMESSAGE_INPUT_H
+
+
+#define MESSAGE_INPUT_KEYBOARD 0x00001100
+#define MESSAGE_INPUT_MOUSE 0x00001200
+#define MESSAGE_INPUT_WIIMOTE 0x00001400
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct input_payload_keyboard
+{
+ int specialkey;
+ int key;
+ int modifier;
+ int x;
+ int y;
+};
+
+struct input_payload_mouse
+{
+ int passive;
+ int button;
+ int state;
+ int x;
+ int y;
+};
+
+
+enum wiimote_btns
+{
+ WIIMOTE_BUTTON_TWO = 0x0001,
+ WIIMOTE_BUTTON_ONE = 0x0002,
+ WIIMOTE_BUTTON_B = 0x0004,
+ WIIMOTE_BUTTON_A = 0x0008,
+ WIIMOTE_BUTTON_MINUS = 0x0010,
+ WIIMOTE_BUTTON_HOME = 0x0080,
+ WIIMOTE_BUTTON_LEFT = 0x0100,
+ WIIMOTE_BUTTON_RIGHT = 0x0200,
+ WIIMOTE_BUTTON_DOWN = 0x0400,
+ WIIMOTE_BUTTON_UP = 0x0800,
+ WIIMOTE_BUTTON_PLUS = 0x1000,
+ WIIMOTE_BUTTON_ALL = 0x1F9F
+};
+
+struct rawdot { int rx, ry; };
+
struct input_payload_wiimote
{
- unsigned short btns;
- ir_t ir;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+ int btns, //button bitmask
+ nrdots;
+ double relX, //relative x coordinate of mouse cursor [0,1]
+ relY, //relative y coordinate of mouse cursor [0,1]
+ Zdist; //distance from sensorbar in mm
+ struct rawdot irdot[4];
+ char posDataValid; //is true when the position data is valid (nrdots > 1)
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif