def METHOD_NAME(self):
    keylist = self.keylist
    if keylist is not None:
        keylist += [u'escape']
    timeout = self.timeout
    start_time = self.experiment.clock.time()
    while True:
        # Don't use the timeStamped keyword, because it bugs on older
        # versions of PsychoPy (at least 1.79.01 under Ubuntu 14.04).
        # See https://github.com/smathot/OpenSesame/issues/381
        time = self.experiment.clock.time()
        keys = event.getKeys(keylist, modifiers=True)
        for key, modifiers in keys:
            if key == u'escape':
                self.experiment.pause()
            if keylist is None or key in keylist:
                self._latest_modifiers = modifiers
                return key, time
        if timeout is not None and time - start_time >= timeout:
            break
    self._latest_modifiers = {}
    return None, time