/* -*- 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 smoothsbdot { double sx, sy; }; //raw smoothed dots struct input_payload_wiimote { int btns, //current button state btnsDown, //buttons that that were pressed btnsUp, //buttons that were released 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]; struct smoothsbdot SensorBarDot[2]; //grouped averaged and smoothed ir sensorbar dots char posDataValid; //is true when the position data is valid (nrdots > 1) }; #ifdef __cplusplus } #endif #endif