Only xclick can catch callback execution.
[scilab.git] / scilab / modules / gui / src / java / org / scilab / modules / gui / events / GlobalEventWatcher.java
index 6eb0dbc..9ececd9 100644 (file)
@@ -27,6 +27,7 @@ public final class GlobalEventWatcher {
        private static GlobalMouseEventWatcher mouseWatcher;
        private static boolean activated;
     private static String axesUID = null;
+    private static boolean catchingCallback = false;
 
        /**
         * Private Constructor : SINGLETON.
@@ -78,6 +79,7 @@ public final class GlobalEventWatcher {
                Toolkit.getDefaultToolkit().removeAWTEventListener(GlobalEventWatcher.keyWatcher);
                Toolkit.getDefaultToolkit().removeAWTEventListener(GlobalEventWatcher.mouseWatcher);
                activated = false;
+               catchingCallback = false;
        }
 
        /**
@@ -96,4 +98,16 @@ public final class GlobalEventWatcher {
         return axesUID ;
     }
 
+    public static void enableCatchingCallback() {
+        catchingCallback = true;  
+    }
+
+    public static void disableableCatchingCallback() {
+        catchingCallback = false;  
+    }
+
+    public static boolean isCatchingCallback() {
+        return catchingCallback;  
+    }
+    
 }