Browse Source

added lockControls

Dave Schuyler 20 years ago
parent
commit
b2f3e2ed45
1 changed files with 10 additions and 0 deletions
  1. 10 0
      direct/src/controls/ControlManager.py

+ 10 - 0
direct/src/controls/ControlManager.py

@@ -127,6 +127,14 @@ class ControlManager:
             oldControls.delete()
             oldControls.delete()
             del self.controls[name]
             del self.controls[name]
 
 
+    if __debug__:
+        def lockControls(self):
+            self.ignoreUse=True
+
+        def unlockControls(self):
+            if hasattr(self, "ignoreUse"):
+                del self.ignoreUse
+    
     def use(self, name, avatar):
     def use(self, name, avatar):
         """
         """
         name is a key (string) that was previously passed to add().
         name is a key (string) that was previously passed to add().
@@ -136,6 +144,8 @@ class ControlManager:
         See also: add().
         See also: add().
         """
         """
         assert self.notify.debugCall(id(self))
         assert self.notify.debugCall(id(self))
+        if __debug__ and hasattr(self, "ignoreUse"):
+            return
         controls = self.controls.get(name)
         controls = self.controls.get(name)
 
 
         if controls is not None:
         if controls is not None: