title: How to capture a keyboard event with PyQt?
body: <p>I need to capture a keyboard event and print it to console. I'm new to PyQt and  programming. </p>
  
  <p>I've read about QKeyEvent but can't understand how it work and how i can use it.</p>
  
  <p>in pseudocode, i think it will be look like this:</p>
  
  <pre><code>def captureEvent():
      While True:
          if keyBoardButton wasUsed:
              print('KeyBoard was used now')
  </code></pre>
  
  <p>I don't need to know what button on keyboard was pressed, i need only event of it and print it event every time when event is happening. I mean if i tap on keyboard buttons right now it should be printed in console</p>