From 45ee95f5e25ad82585da1b965184400e78f413a3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 1 Dec 2018 11:56:59 +0000 Subject: [PATCH] Apply CharHook uniformly as other platforms appear to have issues. Fixes: lp:1806124 * https://bugs.launchpad.net/kicad/+bug/1806124 --- pcbnew/dialogs/dialog_text_properties.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pcbnew/dialogs/dialog_text_properties.cpp b/pcbnew/dialogs/dialog_text_properties.cpp index 90762258f5..f809522527 100644 --- a/pcbnew/dialogs/dialog_text_properties.cpp +++ b/pcbnew/dialogs/dialog_text_properties.cpp @@ -138,7 +138,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BO // wxTextCtrls fail to generate wxEVT_CHAR events when the wxTE_MULTILINE flag is set, // so we have to listen to wxEVT_CHAR_HOOK events instead. - m_MultiLineText->Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), NULL, this ); + Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), NULL, this ); FinishDialogSettings(); } @@ -146,7 +146,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BO DIALOG_TEXT_PROPERTIES::~DIALOG_TEXT_PROPERTIES() { - m_MultiLineText->Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), NULL, this ); + Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), NULL, this ); } @@ -183,10 +183,15 @@ void DIALOG_TEXT_PROPERTIES::OnCharHook( wxKeyEvent& aEvent ) NavigateIn( flags ); } - else if( aEvent.GetKeyCode() == WXK_RETURN && aEvent.ShiftDown() ) + else if( aEvent.GetKeyCode() == WXK_RETURN ) { - TransferDataFromWindow(); - EndModal( wxID_OK ); + if( FindFocus() == m_MultiLineText && !aEvent.ShiftDown() ) + aEvent.Skip(); + else + { + TransferDataFromWindow(); + EndModal( wxID_OK ); + } } else {