title: TypeError: on_press() missing 1 required positional argument: 'key'
body: <p>im pretty new to programming and i hope i can discribe my problem precisely.
  i want to monitor the input my keyboard but i get this TypeError: on_press() missing 1 required positional argument: 'key'.</p>
  
  <p>when i implement the function alone it works fine.</p>
  
  <pre><code>from pynput import keyboard
  
  def on_press(key):
  keys=[]
  try: k = key.char # single-char keys
  except: k = key.name # other keys
  #if key == keyboard.Key.esc: return False # stop listener
  if k in ['down', 'left', 'right',"up"]: # keys interested
      # self.keys.append(k) # store it in global-like variable
      #print('Key pressed: ' + k)
      keys.append(k)
  
  return keys
  
  lis = keyboard.Listener(on_press=on_press)
  lis.start() # start to listen on a separate thread
  lis.join() # no this if main thread is polling self.keys
  </code></pre>
  
  <p>... but if i call the function from the main </p>
  
  <pre><code>pressed_key = on_press()
  </code></pre>
  
  <p>the following error appears:</p>
  
  <pre><code>File "&lt;ipython-input-7-c3f93c434982&gt;", line 80, in main
  pressed_key = on_press()
  
  TypeError: on_press() missing 1 required positional argument: 'key'
  </code></pre>
  
  <p>Please let me know if you have any idea!</p>