title: I want to run a command until I let go of the key
body: <p>I have coded some motors on an RC car and copied some code which uses the curses module. At the moment when I control the car it runs the same command such as forwards or left until I give it another such as right. I want it to stop moving when I release the key. How would I do that?</p>
  <pre><code>try:
  shell = curses.initscr()
  shell.nodelay(False)
  curses.noecho()
  
  
  while True:
      key = shell.getch()
      
      if key ==  65:
          right()
          time.sleep(0.1)
  </code></pre>
  <p>That's the code I've been using so any help would be much appreciated.</p>