Special handling for ALT key in Scintilla so focus doesn't go to menubar?

23 views
Skip to first unread message

Stephane Charette

unread,
Jun 21, 2017, 6:45:53 PM6/21/17
to scintilla-interest
Using Scintilla v3.7.3, building with VisualStudio2008.  (<sigh>...!)  Company has plans to upgrade to VS2015 later this year.

Rectangular selection is working great.  Hold down ALT, click with mouse and select rectangular area.

But as soon as the ALT key is released, focus moves to "File" in the menubar and the blinking multi-line cursor in Scintilla at the edge of the rectangular selection disappears.

When I press and release ALT again, then the menubar loses focus and the blinking cursor is back in the editor.

The SciTE demo doesn't have this behaviour.  The editor somehow still maintains focus after the ALT key is released.  Is there some special handling for ALT in SciTE that I should be looking at?  Browsing through the SciTE source code, nothing obvious stood out.

Thanks for any hints,

Stéphane Charette

Neil Hodgson

unread,
Jun 22, 2017, 5:54:58 PM6/22/17
to scintilla...@googlegroups.com
Stephane Charette:

> But as soon as the ALT key is released, focus moves to "File" in the menubar and the blinking multi-line cursor in Scintilla at the edge of the rectangular selection disappears.
>
> When I press and release ALT again, then the menubar loses focus and the blinking cursor is back in the editor.
>
> The SciTE demo doesn't have this behaviour. The editor somehow still maintains focus after the ALT key is released. Is there some special handling for ALT in SciTE that I should be looking at? Browsing through the SciTE source code, nothing obvious stood out.

SciTE does nothing special here. There is a fairly normal event loop and a ModelessHandler which snoops for hot keys. Check your event loop and any WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN and WM_SYSKEYUP handlers.

Scintilla includes a small test application written in Python: scintilla/test/xite.py. This also behaves correctly and does not show the problem.

Neil

Stephane Charette

unread,
Jun 22, 2017, 6:02:57 PM6/22/17
to scintilla-interest, nyama...@me.com
I see other people have posted about this in the past.  Like them, I'm also using Scintilla in a MFC application that uses CMDIFrameWndEx.  For example:


If I correctly understand what Kenny Liu is saying here, there isn't much I can do:  https://groups.google.com/d/msg/scintilla-interest/v-1QjrXfLC4/70rMFQULTlEJ

Stéphane
Reply all
Reply to author
Forward
0 new messages