From 95cfddf3a633e9f915704695df586d1497d1c8cd Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 3 Dec 2023 16:15:51 +0000 Subject: [PATCH] Fix some issues with hotkey paste in WX_GRIDs. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16253 --- common/grid_tricks.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/grid_tricks.cpp b/common/grid_tricks.cpp index 39b9dae97e..b0a848b2bc 100644 --- a/common/grid_tricks.cpp +++ b/common/grid_tricks.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -492,7 +493,13 @@ void GRID_TRICKS::onCharHook( wxKeyEvent& ev ) stripped.Replace( ROW_SEP, " " ); stripped.Replace( ROW_SEP_R, " " ); stripped.Replace( COL_SEP, " " ); - paste_text( stripped ); + + // Write to the CellEditControl if we can + if( wxTextEntry* te = dynamic_cast( ev.GetEventObject() ) ) + te->WriteText( stripped ); + else + paste_text( stripped ); + handled = true; } }