title: Pipe all keyboard commands automatically to an embedded mplayer instance when a modifier key is pressed in pyqt4
body: <p>This is a follow up question to this answer: <a href="https://stackoverflow.com/a/11939294/406686">https://stackoverflow.com/a/11939294/406686</a>:</p>
  
  <p>Consider the following code, which embeds mplayer in a <code>QWidget</code>. The problem is that it doesn't react to any mplayer keyboard shortcuts such as right arrow for seek forward and so on. </p>
  
  <p>It's clear that I can reimplement every shortcut manually. However is there a way to pipe all keyboard sequences automatically to mplayer as long as a modifier key, say ALT or Win-Key is pressed?</p>
  
  <p>For example: Press <kbd>ALT</kbd> + <kbd>→</kbd> = seek forward...</p>
  
  <pre><code>import mpylayer
  from PyQt4 import QtGui, QtCore
  
  class Window(QtGui.QWidget):
      def __init__(self):
          QtGui.QWidget.__init__(self)
          self.container = QtGui.QWidget(self)
          self.container.setStyleSheet('background: black')
          self.button = QtGui.QPushButton('Open', self)
          self.button.clicked.connect(self.handleButton)
          layout = QtGui.QVBoxLayout(self)
          layout.addWidget(self.container)
          layout.addWidget(self.button)
          self.mplayer = mpylayer.MPlayerControl(
              'mplayer', ['-wid', str(self.container.winId())])
  
      def handleButton(self):
          path = QtGui.QFileDialog.getOpenFileName()
          if not path.isEmpty():
              self.mplayer.loadfile(unicode(path))
  
  if __name__ == '__main__':
  
      import sys
      app = QtGui.QApplication(sys.argv)
      window = Window()
      window.resize(640, 480)
      window.show()
      sys.exit(app.exec_())
  </code></pre>