From dce865ed4e9fffd96211c41465d552a89315e71b Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 23 Dec 2020 15:30:56 +1100 Subject: [PATCH] fix(developer): Allow unhandled keys to go through to debugger memo Fixes #2690. Fixes #3082. In the debugger, key events such as Enter, Ctrl+C, Ctrl+V were being swallowed by the debug engine if they did not have rules within the keyboard. This change emits the key events so the debug memo can process them normally. --- windows/src/engine/keyman32/kmprocess.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/windows/src/engine/keyman32/kmprocess.cpp b/windows/src/engine/keyman32/kmprocess.cpp index d1f76e1b61..41b8d0b87d 100644 --- a/windows/src/engine/keyman32/kmprocess.cpp +++ b/windows/src/engine/keyman32/kmprocess.cpp @@ -166,7 +166,7 @@ BOOL ProcessHook() _td->app->QueueAction(QIT_VSHIFTUP, Globals::get_ShiftState()); fOutputKeystroke = FALSE; } - else if (!_td->TIPFUpdateable) { + else if (!_td->TIPFUpdateable) { // // #2759: kmtip calls this function twice for each keystroke, first to // determine if we are doing processing work (IsUpdateable() == FALSE), @@ -179,6 +179,17 @@ BOOL ProcessHook() } } + if (fOutputKeystroke && _td->app->DebugControlled()) { + // The debug memo does not receive default key events because + // we capture them all here. So we synthesize the key event for + // the debugger. + _td->app->QueueAction(QIT_VSHIFTDOWN, Globals::get_ShiftState()); + _td->app->QueueAction(QIT_VKEYDOWN, _td->state.vkey); + _td->app->QueueAction(QIT_VKEYUP, _td->state.vkey); + _td->app->QueueAction(QIT_VSHIFTUP, Globals::get_ShiftState()); + fOutputKeystroke = FALSE; + } + if(*Globals::hwndIM() == 0 || *Globals::hwndIMAlways()) { _td->app->SetCurrentShiftState(Globals::get_ShiftState());