diff options
author | Russell Cohen <rcoh@mit.edu> | 2010-11-25 21:44:00 -0500 |
---|---|---|
committer | Russell Cohen <rcoh@mit.edu> | 2010-11-25 21:44:00 -0500 |
commit | 5783d6336f014c05e0e46d7bc35533e70b280582 (patch) | |
tree | b4e0b0b2787b8fe464baadbd375ad6dc6c1dbf76 /operationscore/Input.py | |
parent | b042647b68abdc82490ca6e059993b8eba28904c (diff) |
Added BehaviorChain to support chains of behaviors. Added FollowMouse
parameter to PygameInput to support following of mice. Added component
registry to Util which allows any component to access any other
component. Some changes to the structure of LightInstallation.
Diffstat (limited to 'operationscore/Input.py')
-rw-r--r-- | operationscore/Input.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/operationscore/Input.py b/operationscore/Input.py index 1ba4528..67a7bb0 100644 --- a/operationscore/Input.py +++ b/operationscore/Input.py @@ -13,14 +13,22 @@ class Input(threading.Thread): self.eventQueue = [] self.parentScope = argDict['parentScope'] self.argDict = argDict - if not 'InputId' in argDict: - raise Exception('InputId must be defined in config xml') if not 'RefreshInterval' in argDict: print 'RefreshInterval not defined. Defaulting to .5s.' self.argDict['RefreshInterval'] = 500 self.inputInit() threading.Thread.__init__(self) self.daemon = True #This kills this thread when the main thread stops + #CHEATING until I can get multiple inheritence working + def __setitem__(self,k, item): + self.argDict[k] = item + def __getitem__(self, item): + if item in self.argDict: + return self.argDict[item] + else: + return None + def __getiter__(self): + return self.argDict.__getiter__() def respond(self, eventDict): #if eventDict != []: #pdb.set_trace() |