<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_for_keypresses(self, refresh_rate=1):
 """ Listen to user's keystrokes and return them to caller one at a time. The produced values are instances of blessed.keyboard.Keystroke class. If the user did not press anything with the last `refresh_rate` seconds the generator will yield `None`, allowing the caller to perform any updates necessary. This generator is infinite, and thus needs to be stopped explicitly. """

        if not self._enable_keyboard:
            return
        with self._blessed_term.cbreak():
            while True:
                yield self._blessed_term.inkey(timeout=refresh_rate)