From: Jaakko Salli Date: Thu, 29 Jan 2009 17:43:35 +0000 (+0000) Subject: Do not propagate key events from child controls unless they have modifiers X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c12822fec7f87e7734cabbfcf23b99685fc371ce Do not propagate key events from child controls unless they have modifiers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 56738c1635..764f7e820e 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4832,6 +4832,11 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild ) // Except for TAB and ESC, handle child control events in child control if ( fromChild ) { + // Only propagate event if it had modifiers + if ( !event.HasModifiers() ) + { + event.StopPropagation(); + } event.Skip(); return; } @@ -4905,6 +4910,19 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild ) void wxPropertyGrid::OnKey( wxKeyEvent &event ) { + // If there was editor open and focused, then this event should not + // really be processed here. + if ( IsEditorFocused() ) + { + // However, if event had modifiers, it is probably still best + // to skip it. + if ( event.HasModifiers() ) + event.Skip(); + else + event.StopPropagation(); + return; + } + HandleKeyEvent(event, false); }