27 #define ToggleBit(bf,b) (bf) = ((bf) & b) ? ((bf) & ~(b)) : ((bf) | (b)) 30 #define WIIREMOTE_SAMPLES 16 32 #define DEADZONE_Y 0.3f 33 #define DEADZONE_X 0.5f 35 #define MOUSE_MAX 65535 39 #define WIIREMOTE_X_MIN MOUSE_MAX * DEADZONE_X 40 #define WIIREMOTE_Y_MIN MOUSE_MAX * DEADZONE_Y 42 #define WIIREMOTE_X_MAX MOUSE_MAX * (1.0f + DEADZONE_X + DEADZONE_X) 43 #define WIIREMOTE_Y_MAX MOUSE_MAX * (1.0f + DEADZONE_Y + DEADZONE_Y) 45 #define WIIREMOTE_BUTTON_REPEAT_TIME 30 // How long between buttonpresses in repeat mode 46 #define WIIREMOTE_BUTTON_DELAY_TIME 500 52 #include <sys/socket.h> 53 #include <bluetooth/bluetooth.h> 54 #include <bluetooth/hci.h> 55 #include <bluetooth/hci_lib.h> 58 #include <xbmc/xbmcclient.h> 60 #include "../../lib/c++/xbmcclient.h" 74 void Initialize(
CAddress Addr,
int Socket);
78 bool EnableWiiRemote();
79 bool DisableWiiRemote();
86 void EnableMouseEmulation();
87 void DisableMouseEmulation();
91 void SetBluetoothAddress(
const char * btaddr);
92 void SetSensitivity(
float DeadX,
float DeadY,
int Samples);
93 void SetJoystickMap(
const char *JoyMap);
104 bool CheckConnection();
108 int m_lastKeyPressed;
112 int m_lastKeyPressedNunchuck;
113 int m_LastKeyNunchuck;
114 bool m_buttonRepeatNunchuck;
119 void SetupWiiRemote();
123 bool m_DisconnectWhenPossible;
124 bool m_connectThreadRunning;
127 cwiid_wiimote_t *m_wiiremoteHandle;
128 unsigned char m_ledState;
129 unsigned char m_rptMode;
132 static void MessageCallback(cwiid_wiimote_t *wiiremote,
int mesgCount,
union cwiid_mesg mesg[],
struct timespec *timestamp);
134 static void MessageCallback(cwiid_wiimote_t *wiiremote,
int mesgCount,
union cwiid_mesg mesg[]);
139 static void ErrorCallback(
struct wiimote *wiiremote,
const char *str, va_list ap);
146 bool m_haveIRSources;
149 int m_lastActiveTime;
154 void DisconnectNow(
bool startConnectThread);
157 void CalculateMousePointer(
int x1,
int y1,
int x2,
int y2);
161 void ProcessKey(
int Key);
164 void ProcessNunchuck(
struct cwiid_nunchuk_mesg &Nunchuck);
Definition: xbmcclient.h:90
Wiimote structure.
Definition: wiiuse.h:531
Definition: CWIID_WiiRemote.h:68