# Path: pygaze/libtime.py
# def expstart():
# def get_time():
# def pause(pausetime):
# def expend():
# 
# Path: pygaze/settings.py
# class Settings(object):
#     def __init__(self):
#     def read_module(self, mod):
#     def __getattr__(self, setting):
#     def __setattr__(self, setting, value):
# 
# Path: pygaze/_keyboard/basekeyboard.py
# class BaseKeyboard:
# 
#      """A keyboard for collecting responses"""
# 
#      def __init__(self):
# 
#           """
#           Initializes the Keyboard object
#           
#           arguments
# 
#           None
#           
#           keyword arguments
# 
#           keylist     --     list of keys that are allowed, e.g. ["1","a","enter"]
#                          for the 1, A and Enter keys (default =
#                          KEYLIST)
#           timeout     --     time in milliseconds after which None is returned
#                          on a call to the get_key method when no keypress is
#                          registered (default = KEYTIMEOUT)
#           """
# 
#           pass
# 
#      
#      def set_keylist(self):
# 
#           """
#           Set a list of accepted keys
#           
#           arguments
# 
#           None
#           
#           keyword arguments
# 
#           keylist     --     list of keys that are allowed (e.g.
#                          ["1","a","enter"]) or None to allow all keys
#                          (default = None)
#           
#           returns
# 
#           None          --     sets klist property
#           """
#           
#           pass
# 
# 
#      def set_timeout(self):
# 
#           """
#           Set a timeout (in milliseconds)
#           
#           arguments
# 
#           None
#           
#           keyword arguments
# 
#           timeout     --     time in milliseconds after which None is returned
#                          on a call to get_key method when no keypress is
#                          registered (default = None)
#           
#           returns
#           
#           None     --     sets timeout property
#           """
# 
#           pass
# 
# 
#      def get_key(self):
# 
#           """
#           Wait for keyboard input
#           
#           arguments
# 
#           None
#           
#           keyword arguments
# 
#           keylist     --     list of keys that are allowed (e.g.
#                          ["1","a","enter"]), None to allow all keys or
#                          "default" to use klist property (default = "default")
#           timeout     --     time in milliseconds after which None is returned
#                          when no keypress is registered (default = None);
#                          None for no timeout or "default" to use the timeout
#                          property (default = "default")
#           flush          --     Boolean indicating if all input from before
#                          calling get_key should be ignored, if set to
#                          False keypresses from before calling this
#                          function will be registered, otherwise every
#                          keyboard input from before calling this function
#                          will be flushed (default = False)
#           
#           returns
# 
#           key, presstime     --     key is a string, indicating which button has
#                               been pressed or None when no key has been
#                               pressed
#                               presstime is the time (measured from
#                               expbegintime) a keypress or a timeout occured
#           """
#           
#           pass


from pygaze.libtime import clock
from pygaze import settings
from pygaze._keyboard.basekeyboard import BaseKeyboard
     from pygaze._misc.misc import copy_docstr
import pygaze
import pygame
     import pygame.key

          if keylist == None or keylist == []:
               self.klist = None
          else:
               self.klist = []
               for key in keylist:
                    self.klist.append(key)


     def set_timeout(self, timeout=None):

          # See _keyboard.basekeyboard.BaseKeyboard

          self.timeout = timeout


     def get_key(self, keylist="default", timeout="default", flush=False):

          # See _keyboard.basekeyboard.BaseKeyboard
          
          # set keylist and timeout
          if keylist == "default":
               keylist = self.klist
          if timeout == "default":
               timeout = self.timeout
          
          # flush if necessary
          if flush:
               pygame.event.get(pygame.KEYDOWN)
               
          # starttime

# Path: pygaze/libtime.py
# def expstart():
# def get_time():
# def pause(pausetime):
# def expend():
# 
# Path: pygaze/settings.py
# class Settings(object):
#     def __init__(self):
#     def read_module(self, mod):
#     def __getattr__(self, setting):
#     def __setattr__(self, setting, value):
# 
# Path: pygaze/_keyboard/basekeyboard.py
# class BaseKeyboard:
# 
#      """A keyboard for collecting responses"""
# 
#      def __init__(self):
# 
#           """
#           Initializes the Keyboard object
#           
#           arguments
# 
#           None
#           
#           keyword arguments
# 
#           keylist     --     list of keys that are allowed, e.g. ["1","a","enter"]
#                          for the 1, A and Enter keys (default =
#                          KEYLIST)
#           timeout     --     time in milliseconds after which None is returned
#                          on a call to the get_key method when no keypress is
#                          registered (default = KEYTIMEOUT)
#           """
# 
#           pass
# 
#      
#      def set_keylist(self):
# 
#           """
#           Set a list of accepted keys
#           
#           arguments
# 
#           None
#           
#           keyword arguments
# 
#           keylist     --     list of keys that are allowed (e.g.
#                          ["1","a","enter"]) or None to allow all keys
#                          (default = None)
#           
#           returns
# 
#           None          --     sets klist property
#           """
#           
#           pass
# 
# 
#      def set_timeout(self):
# 
#           """
#           Set a timeout (in milliseconds)
#           
#           arguments
# 
#           None
#           
#           keyword arguments
# 
#           timeout     --     time in milliseconds after which None is returned
#                          on a call to get_key method when no keypress is
#                          registered (default = None)
#           
#           returns
#           
#           None     --     sets timeout property
#           """
# 
#           pass
# 
# 
#      def get_key(self):
# 
#           """
#           Wait for keyboard input
#           
#           arguments
# 
#           None
#           
#           keyword arguments
# 
#           keylist     --     list of keys that are allowed (e.g.
#                          ["1","a","enter"]), None to allow all keys or
#                          "default" to use klist property (default = "default")
#           timeout     --     time in milliseconds after which None is returned
#                          when no keypress is registered (default = None);
#                          None for no timeout or "default" to use the timeout
#                          property (default = "default")
#           flush          --     Boolean indicating if all input from before
#                          calling get_key should be ignored, if set to
#                          False keypresses from before calling this
#                          function will be registered, otherwise every
#                          keyboard input from before calling this function
#                          will be flushed (default = False)
#           
#           returns
# 
#           key, presstime     --     key is a string, indicating which button has
#                               been pressed or None when no key has been
#                               pressed
#                               presstime is the time (measured from
#                               expbegintime) a keypress or a timeout occured
#           """
#           
#           pass


# Path: pygaze/_keyboard/pygamekeyboard.py
from pygaze.libtime import clock
from pygaze import settings
from pygaze._keyboard.basekeyboard import BaseKeyboard
     from pygaze._misc.misc import copy_docstr
import pygaze
import pygame
     import pygame.key

          if keylist == None or keylist == []:
               self.klist = None
          else:
               self.klist = []
               for key in keylist:
                    self.klist.append(key)


     def set_timeout(self, timeout=None):

          # See _keyboard.basekeyboard.BaseKeyboard

          self.timeout = timeout


     def get_key(self, keylist="default", timeout="default", flush=False):

          # See _keyboard.basekeyboard.BaseKeyboard
          
          # set keylist and timeout
          if keylist == "default":
               keylist = self.klist
          if timeout == "default":
               timeout = self.timeout
          
          # flush if necessary
          if flush:
               pygame.event.get(pygame.KEYDOWN)
               
          # starttime

          starttime = clock.get_time()
