[QScintilla] Missing key events

Phil Thompson phil at riverbankcomputing.com
Thu Jan 26 22:36:22 GMT 2012


On Thu, 26 Jan 2012 20:41:13 +0300, Andrei Kopats <hlamer at tut.by> wrote:
> Hi
> 
> I have a problem with the latest QScintilla snapshot.
> 
> My editor clears all Scintilla internal key mappings and processes all
key
> pressings with QActions. But, on the latest version of QScintilla, my
> QActions don't receive some key pressings.
> 
> To make a test for this bug, I modified example-Qt4 from the latest
> QScintilla snapshot. See the code below. I expect that after this
> modifications, standard key mappings does not work. So, we can't move
> cursor or select a text. We can only type symbols. It is correct.
> But, if we selected some text with mouse, we should be able to
copy-paste
> it with Ctrl+C and Ctrl+V, because there are QActions in the Edit menu.
> But, for me, this actions does not work.
> 
> I can't say exactly, when this problem appeared. QScintilla version from
> Ubuntu 11.10 works correctly, but version in Debian wheezy and
> snapshot QScintilla-gpl-snapshot-2.6.1-131138b43c85 is affected.
> 
> Is it a bug, or, am I doing something incorrectly?
> 
> Thanks in advance,
> Andrei Kopats
> http://hlamer.github.com/mksv3/ - Simple programmers text editor
> 
> 
> ...
> MainWindow::MainWindow()
> {
>     textEdit = new QsciScintilla;
> 
>     // Clear all commands
>     textEdit->SendScintilla( QsciScintillaBase::SCI_CLEARALLCMDKEYS );
>     // Ctrl+Key pressings insert some strange symbols. Clear all
mappings.
>     for (char key = 'A'; key <= 'Z'; key++)
>         textEdit->SendScintilla(QsciScintillaBase::SCI_CLEARCMDKEY, key
+
> (QsciScintillaBase::SCMOD_CTRL << 16));
>     // Now I expect, that Ctrl+V, Ctrl+C, Ctrl+X will be processed by
the
> actions, created at MainWindow::createActions()
>     // but, this key pressings are ignored
> 
>     setCentralWidget(textEdit);
> ...

It is a bug (fixed in tonight's snapshot) and you are doing something
incorrectly.

To clear the existing bindings do...

    textEdit->standardCommands()->clearKeys()
    textEdit->standardCommands()->clearAlternateKeys()

Phil


More information about the QScintilla mailing list