Re: [scintilla] Dwell event combined with ctrl key information question in Windows

86 views
Skip to first unread message
Message has been deleted

Neil Hodgson

unread,
Dec 19, 2010, 6:56:53 AM12/19/10
to scintilla...@googlegroups.com
AsmWarrior:

> I would like to receive the dwell( call tip ) event when I hold on the ctrl
> key. currently, In Windows OS, when I hold the ctrl key, the dwel event will
> never sent. but it seems under linux, it works.

On Windows, keeping the Ctrl key pressed causes multiple key press
events to occur just like holding down an arrow key causes multiple
movements. Each time a key press event occurs, Scintilla resets the
dwell timer as normal key presses are interpreted as the user doing
something and not just hovering the mouse.

You could try to filter out these key press events, possibly on the
basis of which key is being pressed or on whether its an auto-repeat.

Neil

AsmWarrior

unread,
Dec 19, 2010, 11:20:15 PM12/19/10
to scintilla...@googlegroups.com
thanks for the reply, it seems my OP was lost.

I have just add a filter int this function, see below:

int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) {

    if (!ctrl)  
        DwellEnd(false);


    int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
            (alt ? SCI_ALT : 0);
    int msg = kmap.Find(key, modifiers);
    if (msg) {
        if (consumed)
            *consumed = true;
        return WndProc(msg, 0, 0);
    } else {
        if (consumed)
            *consumed = false;
        return KeyDefault(key, modifiers);
    }
}

When holding the ctrl key.it seems the tip windows appeared and disappeared quickly. Can you help to give me a direction??
thanks.

asm

Neil Hodgson

unread,
Dec 23, 2010, 6:04:15 PM12/23/10
to scintilla...@googlegroups.com
AsmWarrior:

> I have just add a filter int this function, see below:
>
> int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool
> *consumed) {
>
>     if (!ctrl)
>         DwellEnd(false);

ctrl is a flag indicating that Ctrl is down, which is different
from receiving a key down message for the Ctrl key.

> When holding the ctrl key.it seems the tip windows appeared and disappeared
> quickly. Can you help to give me a direction??

Add some tracing in or use a breakpoint to find out why this is happening.

Neil

AsmWarrior

unread,
Dec 25, 2010, 6:58:56 AM12/25/10
to scintilla...@googlegroups.com

> I have just add a filter int this function, see below:
>
> int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool
> *consumed) {
>
>     if (!ctrl)
>         DwellEnd(false);

   ctrl is a flag indicating that Ctrl is down, which is different
from receiving a key down message for the Ctrl key.

Thanks neil, In-fact, checking this ctrl state works. 

> When holding the ctrl key.it seems the tip windows appeared and disappeared
> quickly. Can you help to give me a direction??

   Add some tracing in or use a breakpoint to find out why this is happening.

   Neil
OK, I have solved this problem, I need to filter out the ctrl key event of the "tip window" ( by default, when the tip window is active and receive a key press event, it will be closed).

Reply all
Reply to author
Forward
0 new messages