I am using pyqt's Qshortcut in trying to detect a key combination to trigger some action i.e when the user types -> into a QtextEdit widget, I would like to print "changing mode". I have seen other key sequence examples that involve CTRL+E or some other CTRL or shift key combination,
self.shcut1 = QtGui.QShortcut(self)
self.shcut1.setKey("CTRL+E")
self.connect(self.shcut1, QtCore.SIGNAL("activated()"), self.close)
But I really want to trap ->(hyphen followed by a greater than sign). Any suggestions on how to do this