@@ -0,0 +1,1980 @@
+/**%0AKhalid%0A*/%0Apackage org.sikuli.slides.sikuli;%0A%0Aimport java.util.concurrent.ExecutionException;%0Aimport java.util.concurrent.ExecutorService;%0Aimport java.util.concurrent.Executors;%0Aimport java.util.concurrent.Future;%0Aimport org.jnativehook.GlobalScreen;%0Aimport org.jnativehook.NativeHookException;%0Aimport org.sikuli.api.ScreenRegion;%0Aimport org.sikuli.slides.listeners.GlobalMouseListeners;%0Aimport org.sikuli.slides.utils.Constants;%0A%0Apublic class SlideTutorial %7B%0A%09private ScreenRegion targetRegion;%0A%09private Constants.DesktopEvent desktopEvent;%0A%09%0A%09public SlideTutorial(ScreenRegion targetRegion, Constants.DesktopEvent desktopEvent)%7B%0A%09%09this.targetRegion=targetRegion;%0A%09%09this.desktopEvent=desktopEvent;%0A%09%7D%0A%09%0A%09public void performTutorialSlideAction() %7B%0A        SikuliController.displayBox(targetRegion);%0A        System.out.print(%22Waiting for user to pefrom %22+this.desktopEvent.toString()+%22 on target.%22);%0A%09%09try %7B%0A        %09if(!GlobalScreen.isNativeHookRegistered())%7B%0A        %09%09GlobalScreen.registerNativeHook();%0A        %09%7D%0A        %09GlobalMouseListeners globalMouseListener=new GlobalMouseListeners(targetRegion,desktopEvent);%0A            GlobalScreen.getInstance().addNativeMouseListener(globalMouseListener);%0A            final ExecutorService service=Executors.newFixedThreadPool(1);%0A            final Future%3CBoolean%3Etask=service.submit(globalMouseListener);%0A            %0A            performUserAction(task);%0A        %7D%0A        catch (NativeHookException ex) %7B%0A            System.err.println(%22There was a problem running the tutorial mode.%22);%0A            System.err.println(ex.getMessage());%0A            System.exit(1);%0A        %7D%0A%0A%09%09%0A%09%7D%0A%09%0A%09private void performUserAction(final Future%3CBoolean%3Etask)%7B%0A%09%09try%7B%0A%09%09%09if(task.get()==true)%7B%0A%09%09%09// passed and add another task%0A%09%09%09System.out.println(desktopEvent.toString()+ %22 performed!%22);%0A%09%09%09return;%0A%09%09%09%7D%0A%09%09%7D%0A        catch (InterruptedException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D catch (ExecutionException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%09%0A%09%7D%0A%7D%0A

add tutorial mode class