> 
>  Logic, time() stop the process.
>  
>  Place your sound in a thread, like this:
>  
>  from threading import Timer
>  
>      def doTrial(self):
>          self.trialRunning = True
>          print('Trial running') #this is where the sounds are presented
>          self.t = Timer(3, self.unblock)
>          self.t.start()
>  
>      def unblock(self):
>          self.trialRunning = False
>  
>      def keyPressEvent(self, event):
>          print self.trialRunning
>          if self.trialRunning:
>              event.accept()
>          elif (event.type() == QtCore.QEvent.KeyPress) and self.trialRunning 
> == False:
>              ...
>  
>  
> 


Thank you very much for the suggestion. I'm not very familiar with using 
threads, so I'll do
a bit of homework first and then I'll try it out.

Sam 

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to