-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(core): LDML processor handling "Enter" frame keys etc does not reset/invalidate the context for non-compliant apps #10955
Comments
The reason for this, I guess, is that the KMX processor treats the Enter key as a 'frame key' and passes the raw key event to the app, which causes a context reset? |
🙀 |
Assigning to you @srl295 in next sprint, as this probably should be addressed before we leave beta |
This question made me go look at the logs again because what you said didn't seem correct. I found that the KMX processor resets the context regardless of compliant or not. I have updated the issue to match. The KMX processor makes the decision to invalidate the context so it is reset in the core in the process_event call before the EMIT keystroke to the app has occurred. |
@srl295 I was testing for #10227 and discovered that it is not just |
So maybe we need a flag in the struct for context reset ? |
I think we need a discussion on this. The decision on what is a frame key is probably OS-dependent. So some of this logic may belong in Engine, some in Core. |
Just to recap the current state (heh) of the ldml_processor.. when a key is 'not found' in the void ldml_event_state::emit_passthrough_keystroke() {
// assert we haven't already requested a keystroke
assert(actions.emit_keystroke != KM_CORE_TRUE);
actions.emit_keystroke = KM_CORE_TRUE;
} The processor definitely doesn't (and, i'd think ideally wouldn't) know whether a VK is a frame key or not. Should the above be sufficient, and engine/core take it from there? Or should there be a hint set which explicitly says, "the processor did not find the requested key"? Looking at |
Yes, this is the spot I was originally thinking you would do a lookup into the VKResetContext data structure at this point unless we can push into the core logic to make the decision. It is almost the equivalent spot in the kmx_processor [ except it has already determined whether it is a character, note and it doesn't map exactly to the old VKResetContext data structure ]. We know the information need for the decision it is:
This could be a call made in |
rough psudeo code could be small private function.
where This could be a call made in For the future we could add support for different frame keys on different OS's |
- move the reset table into its own cpp - update function signatures per review comments Fixes: #10955
- update comments per review Fixes: #10955
- correct invalidate logic Fixes: #10955
- updates to debug_api test for rearranged items - try to rearrange the action queue to match prior behavior Fixes: #10955
- reset for ctrl or alt modifiers, but NOT for key-up Fixes: #10955
- it was the check for deletion that was unneeded Fixes: #10955
- mark event flags as unused for now Fixes: #10955
- clear the app context as well as the cached context Fixes: #10955
- don't invalidate on keyup - don't check context()->empty() - clean up structure and comments Fixes: #10955
Edit: Update after further investigation.
When a Enter is pressed with any app non-compliant or compliant, the KMX process will reset(invalidate) the context. What happens on the following keystroke for a compliant app is the context is read again which includes the newline marker and then is set in the core with
km_core_state_context_set_if_needed
api call.With the LDML processor, the context is not reset. There is no LF character inserted into the context either, however, that would be incorrect, why because not being context away the
enter
could have moved the cursor to a new text field.LDML processor after
aEnterc
Process_Event_Core: context cache after: |ac| (len: 2) [ U+0061 U+0063 ]
KMX processor after
aEnterc
Process_Event_Core: context cache after: |c| (len: 1) [ U+0063 ]
KMX Processor Log for non-compliant
aEnter
d
WordPad Compliant app
aEnter
The text was updated successfully, but these errors were encountered: