JoyStick/WiiMote not working?

Vectrex

30-05-2007 04:07:57

Hi, has anyone actually got any joystick or wiimote stuff to work with MOIS? I can create mice/keyboards fine, but any joystick or wiimote creation stuff crashes.
eg
MOIS.JoyStick jstick;
jstick = (MOIS.JoyStick)inputManager.CreateInputObject(MOIS.Type.OISJoyStick, UseBufferedInput);


Any sample code would be greatly appreciated as there doesn't seem to be any anywhere. In fact there's no wiimote code anywhere :)

rainleaf

04-06-2007 10:50:55

has no one been able to get the MOIS joystick or wii mote to work???

if anyone has any ideas as to why it causes a crash please let me know

pjcast

12-06-2007 20:31:59

It is possible to debug into native code from managed code to find out why. Alternatively, simply add some logging to OIS so that I could at least know what you guys mean by it crashes.

GermanDZ

12-06-2007 22:19:40

I tried MOIS with a joystick and works fine. I just test 2 axes, thats all. But seems to work flawsly.

rainleaf

13-06-2007 13:58:49

:) thanks for replying...would it be possible to supply some sample code for joysticks and more specifically the wii mote....anything u can provide would be much appreciated ...i just need to be sure im doing it correctly first :)

the code ive attempted to create a joystick with is exactly what vectrex printed above..... :D

pjcast

15-06-2007 00:54:41

:) thanks for replying...would it be possible to supply some sample code for joysticks and more specifically the wii mote....anything u can provide would be much appreciated ...i just need to be sure im doing it correctly first :)

the code ive attempted to create a joystick with is exactly what vectrex printed above..... :D


I did not write the MOIS wrapper for OIS, but first you should verify the wiimote works on your system before you try to use it. Once connected to blue tooth, and connected to HID interface, you should see packets coming from the Wiimote connection.

Then, before you ever try to create a joystick, you should call the OIS functions to determine how many devices (joysticks, mice, etc) are discovered attached to the computer. Anyway, there is example code using Wiimote (in c++) with OIS cvs head. But, it is not any different then using a OIS joystick, which you can also find example with OIS cvs. The mappings to C# should be the same or similar to the C++ side.