[PyKDE] Does anybody got the same issue?

Detlev Offenbach detlev at die-offenbachs.de
Sun Jul 9 11:45:30 BST 2006


Hi,

a few words to clarify the workings of eric3. Both the Return and the Enter 
key are mapped by default to the QScintilla command SCI_NEWLINE. Please 
check, if you remapped you keyboard bindings by using the kexboard 
configuration dialog Editor->Insert new line. This entry should show "Return" 
and "Enter" as primary and alternative binding. If it is different for you, 
you have to either change it or use the keys bound to this command.

Over here, Return and Enter produce the key 4100 and 4101 and work ok. I 
suspect, that it is not a buggy code, that is causing your problem. However, 
any further debugging support is welcomed.

Regards,
Detlev

On Sunday 09 July 2006 01:50, Laurent Dufréchou wrote:
> Finally I've found why my enter key don't work...
>
> In Shell.py:
>
> self.supportedEditorCommands = {
>             QextScintilla.SCI_LINEDELETE : self.clearCurrentLine,
>             QextScintilla.SCI_TAB        : self.handleQScintillaTab,
>             QextScintilla.SCI_NEWLINE : self.handleQScintillaNewline,
>
> I've modified keyPresEvent to printout ev.key()
> and it seems that my 'enter' key generate 4100 instead of SCI_NEWLINE(2329)
> I've tried to  add this :)
>     4100    : self.handleQScintillaNewline,
> but it doesn't work...
> In fact 4100 is not recognised in the ENUM of Qscintilla.
>
> So I've modified:
>
> def keyPressEvent(self, ev):
>         """
>         Re-implemented to handle the user input a key at a time.
>
>         @param ev key event (QKeyPressEvent)
>         """
>         txt = ev.text()
>         key = ev.key()
>         asc = ev.ascii()
>         buf = unicode('')
>     #self.insert(str(key))
>     # See it is text to insert.
>         if txt.length():
>         if key == 4100:                                           <--
>             self.handleQScintillaNewline(cmd)          <--
>         return
>             if self.echoInput:
>                 ac = self.isAutoCompletionActive()
>                 QextScintillaCompat.keyPressEvent(self, ev, cmd)
>                 self.incrementalSearchActive = True
>                 if ac and \
>                    self.racEnabled:
>
> self.dbs.remoteCompletion(self.completionText+unicode(txt))
>             else:
>                 self.insertTextNoEcho(txt)
>             return
>         else:
>             ev.ignore()
>
>
> The fact is that self.handleQScintillaNewline needs 'cmd' that is not in
> keyPressEvent scope...
> Can you help me to corresct this?
> Or perhaps this is not the right way to handle my bug?
>
> (What ? Just update PyQt ? well that a possibility ^_^ )
>
> Laurent

-- 
Detlev Offenbach
detlev at die-offenbachs.de




More information about the PyQt mailing list