title: pynput, need to trigger only on key presses
body: <p>Usng pynput, I would like to execute some code only when some keys are pressed.</p>
  <pre><code>import sys 
  print( sys.executable )
  
  from pynput import keyboard
  from pynput.keyboard import Key, Controller
  import time
  import win32ui
  import dde
  import pandas as pd
  import numpy as np
  import os
  
  keyboard_controller = Controller()
  
  # The event listener will be running in this block
  with keyboard.Events() as events:
      for event in events:
          if event.key == keyboard.Key.esc:
              break
          if event.key == keyboard.Key.f10:
              print('Received event {}'.format(event))
  </code></pre>
  <p>When pressing f10, this outputs</p>
  <pre><code>Received event Press(key=Key.f10)
  Received event Release(key=Key.f10)
  </code></pre>
  <p>How can I get rid of the 'release' event and only execute code on key press?</p>