fix: Add invalidate context action to non-updatable parse

Rename ProcessActionsTestParse to NonUpdatable parse. It does
more then just test. Add handling for the invalidate context action
to this parse, so that if we emit a keystroke we invalidate the context
This commit is contained in:
Ross 2022-08-22 11:51:01 +10:00
parent 75d86e2e53
commit 6fc623e4f3
3 changed files with 9 additions and 6 deletions

View file

@ -190,7 +190,7 @@ BOOL ProcessHook()
}
if (!_td->TIPFUpdateable) {
ProcessActionsTestParse(&fOutputKeystroke);
ProcessActionsNonUpdatableParse(&fOutputKeystroke);
} else {
ProcessActions(&fOutputKeystroke);
}

View file

@ -167,7 +167,7 @@ BOOL ProcessActions(BOOL* emitKeyStroke)
}
BOOL
ProcessActionsTestParse(BOOL* emitKeyStroke) {
ProcessActionsNonUpdatableParse(BOOL* emitKeyStroke) {
PKEYMAN64THREADDATA _td = ThreadGlobals();
if (!_td) {
return FALSE;
@ -184,13 +184,16 @@ ProcessActionsTestParse(BOOL* emitKeyStroke) {
switch (act->type) {
case KM_KBP_IT_EMIT_KEYSTROKE:
*emitKeyStroke = TRUE;
SendDebugMessageFormat(0, sdmGlobal, 0, "ProcessActionsTestParse EMIT_KEYSTROKE: act->type=%d", act->type);
SendDebugMessageFormat(0, sdmGlobal, 0, "ProcessActionsNonUpdatableParse EMIT_KEYSTROKE: act->type=[%d]", act->type);
continueProcessingActions = TRUE;
_td->CoreProcessEventRun = FALSE; // If we emit the key stroke on this parse we don't need the second parse
break;
case KM_KBP_IT_CAPSLOCK:
continueProcessingActions = processCapsLock(act, !_td->state.isDown, _td->TIPFUpdateable);
break;
case KM_KBP_IT_INVALIDATE_CONTEXT:
continueProcessingActions = processInvalidateContext(_td->app, _td->lpActiveKeyboard->lpCoreKeyboardState);
break;
}
if (!continueProcessingActions) {
return FALSE;

View file

@ -18,12 +18,12 @@ BOOL ProcessActions(BOOL* emitKeyStroke);
/**
* This function process the actions queued in the core processor in
* the non updateable parse of a keystroke.
* Emit keystroke and capslock are required to be processed in this phase.
* the non-updateable parse of a keystroke.
* Emit keystroke , capslock, and possibly invalidate key stroke are required to be processed in this phase.
*
* @param [in, out] emitKeyStroke is set to true if requested by the core action queue
* @return BOOL True if actions were successfully processed
*/
BOOL ProcessActionsTestParse(BOOL* emitKeyStroke);
BOOL ProcessActionsNonUpdatableParse(BOOL* emitKeyStroke);
#endif