Index: liacs/mms/project/colour-tracking.c
===================================================================
--- liacs/mms/project/colour-tracking.c	(revision 22)
+++ liacs/mms/project/colour-tracking.c	(revision 23)
@@ -85,12 +85,19 @@
     int r, g, b;
     int q;
+    int x_move, y_move;
+
     int retval;
     char arg1[4], arg2[4];
     int keycode;
     // Actually move the pointer to it's location
-    int mouse_flag = 1;
+    int mouse_flag = 0;
+    int r_window_flag = 1;
+    int g_window_flag = 1;
+    int b_window_flag = 1;
     // XXX: Hack to have the pointer posted on the second screen.
     int ex_screen_flag = 0;
-	
+    int x_ajust = -114;
+    int y_ajust = -95;
+
     
     int cvalue = 0;
@@ -112,6 +119,6 @@
 
         //cvCopy(image, output, NULL);
-	//Remove Noise from images
-	cvSmooth(image,output,CV_BLUR, 3, 3, 3,3);
+        //Remove Noise from images
+	    cvSmooth(image,output,CV_BLUR, 3, 3, 3,3);
         cvCopy(image, routput, NULL);
         cvCopy(image, goutput, NULL);
@@ -175,12 +182,12 @@
         cvCircle(target, cvPoint(xmax, ymax), 10, CV_RGB(255,0,0),4, 8, 0);
         // Set to pointer to new location
+        // Some Hacking to get the pointer synced
         if (mouse_flag) {
+            x_move = ratio(xmax + x_ajust,width,screen_width);
+            y_move = ratio(ymax + y_ajust,height,screen_height);
             if (ex_screen_flag) {
-                xdo_mousemove(xdo, ratio(xmax,width,screen_width) + screen_width - 250, 
-                    ratio(ymax,height,screen_height));
-            } else {
-                xdo_mousemove(xdo, ratio(xmax,width,screen_width), 
-                    ratio(ymax,height,screen_height));
+                x_move += screen_width;
             }
+            xdo_mousemove(xdo, x_move, y_move);
         }
                         
@@ -188,7 +195,10 @@
         // Show all the images
         cvShowImage("RGB_Image", output);
-        cvShowImage("R_Image", routput);
-        cvShowImage("B_Image", boutput);       
-        cvShowImage("G_Image", goutput);       
+        if (r_window_flag)
+            cvShowImage("R_Image", routput);
+        if (b_window_flag)
+            cvShowImage("B_Image", boutput);       
+        if (g_window_flag)
+            cvShowImage("G_Image", goutput);       
         cvShowImage("F_Image", target);       
                     
@@ -202,10 +212,31 @@
 		        break;
             } else if (keycode == 'm') {
-                mouse_flag =  (mouse_flag == 1) ? 0 : 1;
+                mouse_flag ^= 1;
             } else if (keycode == 'e') {
-                ex_screen_flag =  (ex_screen_flag == 1) ? 0 : 1;
-
+                ex_screen_flag ^= 1;
+            // Hack to manually sync mouse pointer with laser pointer
+            } else if (keycode == 'w' || keycode == 's' || keycode == 'a' || \
+                keycode == 'd') { 
+                if (keycode == 'w') {
+                    y_ajust--;
+                } else if (keycode == 's') {
+                    y_ajust++;
+                } else if (keycode == 'a') {
+                    x_ajust--;
+                } else if (keycode == 'd') {
+                    x_ajust++;
+                }
+                printf("New x,y ajust: %i,%i\n",x_ajust,y_ajust);
+            } else if (keycode == 'r' || keycode == 'g' || keycode == 'b') {
+                printf("Toggle window: %c\n", keycode);
+                if (keycode == 'r') {
+                    r_window_flag ^= 1;
+                } else if (keycode == 'g') {
+                    g_window_flag ^= 1;
+                } else if (keycode == 'b') {
+                    b_window_flag ^= 1;
+                }
             }
-	    }
+        }
     } //for each frame ...
 
@@ -226,4 +257,15 @@
 int main(int argc, char *argv[]) {
    int retval;
+   printf("=== INSTRUCTION == \n\
+Keybindings:\n\
+e = toggle mouse on external screen mouse pointer\n\
+m = toggle mouse tracking\n\
+q = quit\n\
+Mouse/laser pointer syncer:\n\
+w = up\n\
+s = down\n\
+a = left\n\
+f = right\n\
+");
    xdo = xdo_new(getenv("DISPLAY"));
    retval = InitSystem(argc, argv);
