@@ -0,0 +1,1399 @@
+import com.aldebaran.qimessaging.Application;%0Aimport com.aldebaran.qimessaging.CallError;%0Aimport com.aldebaran.qimessaging.Future;%0Aimport com.aldebaran.qimessaging.Object;%0Aimport com.aldebaran.qimessaging.Session;%0A%0Apublic class ReactToEvents %7B%0A%0A%09private Object tts;%0A%09private Object memory;%0A%09private CallBack callback;%0A%0A%09public class CallBack %7B%0A%09%09private Object tts;%0A%0A%09%09public CallBack(Object tts) %7B%0A%09%09%09this.tts = tts;%0A%09%09%7D%0A%0A%09%09public void onTouch(java.lang.Object value) %7B%0A%09%09%09float data = (Float) value;%0A%09%09%09if (data == 1.0) %7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09tts.call(%22say%22, %22ouch%22);%0A%09%09%09%09%7D catch (CallError error) %7B%0A%09%09%09%09%09System.err.println(error.getMessage());%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%7D%0A%0A%09public void run(String%5B%5D args) throws Exception %7B%0A%09%09String url = %22tcp://nao.local:9559%22;%0A%09%09if (args.length == 1) %7B%0A%09%09%09url = args%5B0%5D;%0A%09%09%7D%0A%09%09Application application = new Application(args);%0A%09%09Session session = new Session();%0A%09%09Future%3CVoid%3E fut = session.connect(url);%0A%09%09synchronized(fut) %7B%0A%09%09%09fut.wait(1000);%0A%09%09%7D%0A%09%09tts = session.service(%22ALTextToSpeech%22);%0A%09%09callback = new CallBack(tts);%0A%09%09memory = session.service(%22ALMemory%22);%0A%09%09Object subscriber = (Object) memory.call(%22subscriber%22,%0A%09%09%09%09%22FrontTactilTouched%22).get();%0A%09%09subscriber.connect(%22signal::(m)%22, %22onTouch::(m)%22, callback);%0A%09%09application.run();%0A%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) throws Exception %7B%0A%09%09ReactToEvents reactor = new ReactToEvents();%0A%09%09reactor.run(args);%0A%09%7D%0A%7D%0A

add ReactToEvents example