'Qt override.'

def keyPressEvent(self, e):

    key = e.key()
    if (key not in VALID_KEYS):
        self.invalid_key_flag = True
        return
    self.npressed += 1
    self.key_non_modifiers.append(key)
    self.key_modifiers.add(key)
    self.key_text.append(e.text())
    self.invalid_key_flag = False
    debug_print('key    {0},    npressed:    {1}'.format(key, self.npressed))
    if (key == Qt.Key_unknown):
        return
    if ((key == Qt.Key_Control) or (key == Qt.Key_Shift) or (key == Qt.Key_Alt) or (key == Qt.Key_Meta)):
        return
    modifiers = e.modifiers()
    if (modifiers & Qt.ShiftModifier):
        key += Qt.SHIFT
    if (modifiers & Qt.ControlModifier):
        key += Qt.CTRL
        if (sys.platform == 'darwin'):
            self.npressed -= 1
        debug_print('decrementing')
    if (modifiers & Qt.AltModifier):
        key += Qt.ALT
    if (modifiers & Qt.MetaModifier):
        key += Qt.META
    self.keys.add(key)
