title: Pyside (or PyQt) Global shortcuts
body: <p>I am looking to create a shortcut for my application that will still look for input while my application does not have focus. QShortcut and QApplicationShortcut don't seem to do what I need.</p>
  
  <p>This is what I have. I would like to be able to trigger <code>self.onplaybutton()</code> while a different application has focus.</p>
  
  <pre><code>self.shortcut = QtGui.QShortcut(self.mainWindow)
  self.shortcut.setKey('A')
  self.shortcut.activated.connect(lambda: self.onplaybutton())
  </code></pre>