From 970e54bc2824693cce7e2d720f02b1ef1995642d Mon Sep 17 00:00:00 2001 From: "guilhem.duche" Date: Thu, 13 Mar 2008 22:48:38 +0000 Subject: [PATCH] Edited wiki page through web user interface. git-svn-id: http://wiiusej.googlecode.com/svn/wiki@100 ae48ae66-6a45-0410-b38e-211266189506 --- Documentation.wiki | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Documentation.wiki b/Documentation.wiki index 6c1545c..7fb7460 100644 --- a/Documentation.wiki +++ b/Documentation.wiki @@ -6,13 +6,16 @@ =Detailed documentation= -WiiuseJ is very easy to use. -You have very few things to do get info from your wiimote(s). -First : make a project. Import wiiusej.jar and in it put the 2 dlls files at the root of your project. +WiiuseJ is very easy to use. You have very few things to do get info from your wiimote(s). + + +First, make a project. Import wiiusej.jar and in it put the 2 dlls files at the root of your project. + Then make a class ( for example MyClass ) and implements WiimoteListener with it. For example, in the following example, each method implemented receives the differents event Types : ButtonsEvent, IREvent, MotionSensingEvent, StatusEvent and DisconnectionEvent (check Javadoc to see what infos you get from each event type). In this case in each method we only display the event received. + {{{ public class MyClass implements WiimoteListener{ @@ -53,15 +56,19 @@ Next you can make a main. Like this : } }}} + Here you ask to try to connect to 1 wiimote. You can ask for more if more are connected. It returns you an array with the connected wiimote. Then you can manipulate each wiimote and activate IR tracking, motion tracking and set up other parameters if you want... Check javadoc for more details. + {{{ wiimote.addWiiMoteEventListeners(new MyClass()); }}} + This line permits you to set an instance of MyClass as a listener of the wiimote. When events from this wiimote occur they are sent to every WiimoteListener. Here there is only one, an instance of MyClass. + If you launch this program it will display the content of every events.