Dustin Barnard пре 18 година
родитељ
комит
087eab8a17
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7 2
      direct/src/directtools/DirectSession.py

+ 7 - 2
direct/src/directtools/DirectSession.py

@@ -181,6 +181,8 @@ class DirectSession(DirectObject):
                             'alt-mouse3', 'alt-mouse3-up',
                             ]
 
+        self.passThroughKeys = ['v','b','l','p', 'r', 'shift-r', 's', 't','shift-a', 'w'] 
+
         if base.wantTk:
             from direct.showbase import TkGlobal
             from direct.tkpanels import DirectSessionPanel
@@ -201,6 +203,10 @@ class DirectSession(DirectObject):
         __builtins__['cluster'] = self.cluster
 
 
+    def addPassThroughKey(self,key):
+
+        self.passThroughKeys.append(key)
+
     def enable(self):
         # don't enable DIRECT if someone has posted DIRECTdisablePost
         if bboard.has(DirectSession.DIRECTdisablePost):
@@ -460,8 +466,7 @@ class DirectSession(DirectObject):
 
         #Pass along certain events if this display is a cluster client
         if self.clusterMode == 'client':
-            if input in ('v','b','l','p', 'r', 'shift-r', 's', 't',
-                         'shift-a', 'w'):
+            if input in self.passThroughKeys:
                 self.cluster('messenger.send("%s")' % input, 0)
 
     def getModifiers(self, input, base):