Hi Torsten and List User,

I had the same problem with AltGR but another solution,
maybe useful for those who do not like to patch QScintilla at C-Level:

Thank you for your analysis, I did check the ascii-value first and then just set the
state to 0 to pass just the ascii - key. But your solution is the better one

Regards,
 Timo

Just subclass the keyPressEvent Handler and modify it,

class SomeClassEdit(QextScintilla):
    def __init__(self,parent=None,name=None,flags=0):
        QextScintilla.__init__(self, parent, name, flags | Qt.WDestructiveClose)
         ...
         blabala
         ...

    def keyPressEvent(self,ke):
        # In windows scintilla, Alt Gr expansion lead to command expansion
        # and thus with German keyboards and others no characters which need
        # alt gr can be composed
        # Workaround : Subclass KeyEvent-Handler and modify Key-Event for
        #              to translate Alt and Control to Meta
        #
        #
        if ke.state() ==  Qt.AltButton | Qt.ControlButton :
                mke = QKeyEvent(ke.type(),ke.key(),ke.ascii(),Qt.MetaButton,ke.text())
                ke.accept()
                QextScintilla.keyPressEvent(self,mke)
        else:
                QextScintilla.keyPressEvent(self,ke)







_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to