chore(mac): use core actions struct#10066
Conversation
User Test ResultsTest specification and instructions
|
Test Results |
mcdurdin
left a comment
There was a problem hiding this comment.
This is looking fantastic. Most of my comments are nits, but a couple of things I don't fully understand.
| -(void) dealloc { | ||
| CFRelease(self.eventSource); | ||
| - (void)sendBackspaceforEventSource:(CGEventSourceRef)eventSource { | ||
| [self.appDelegate logDebugMessage:@"KeySender sendBackspaceforSourceEvent"]; |
There was a problem hiding this comment.
| [self.appDelegate logDebugMessage:@"KeySender sendBackspaceforSourceEvent"]; | |
| [self.appDelegate logDebugMessage:@"KeySender sendBackspaceforEventSource"]; |
| CGEventRef ev = CGEventCreateKeyboardEvent (source, virtualKey, true); //down | ||
| if (postEvent) | ||
| postEvent(ev); | ||
| CFRelease(ev); | ||
| ev = CGEventCreateKeyboardEvent (source, virtualKey, false); //up | ||
| if (postEvent) | ||
| postEvent(ev); | ||
| CFRelease(ev); |
There was a problem hiding this comment.
This seems like it has a precondition of if(!postEvent) return;?
| CGEventRef ev = CGEventCreateKeyboardEvent (source, virtualKey, true); //down | |
| if (postEvent) | |
| postEvent(ev); | |
| CFRelease(ev); | |
| ev = CGEventCreateKeyboardEvent (source, virtualKey, false); //up | |
| if (postEvent) | |
| postEvent(ev); | |
| CFRelease(ev); | |
| if(!postEvent) { | |
| // TODO: add logging? how could this happen? | |
| return; | |
| } | |
| CGEventRef ev = CGEventCreateKeyboardEvent (source, virtualKey, true); //down | |
| postEvent(ev); | |
| CFRelease(ev); | |
| ev = CGEventCreateKeyboardEvent (source, virtualKey, false); //up | |
| postEvent(ev); | |
| CFRelease(ev); |
There was a problem hiding this comment.
It should never happen, but I'll change to add logging.
| // Returns the frontmost app, which is the app that receives key events. | ||
| NSRunningApplication *app = NSWorkspace.sharedWorkspace.frontmostApplication; | ||
| pid_t processId = app.processIdentifier; | ||
| NSString *appName = app.localizedName; |
There was a problem hiding this comment.
is localizedName the most helpful string for debug logging? Might not be better to use an identifier of some kind?
There was a problem hiding this comment.
changed to use bundleId
| [clientAppId isEqual: @"com.adobe.InDesign"] || | ||
| [clientAppId isEqual: @"com.adobe.Photoshop"] || | ||
| [clientAppId isEqual: @"com.adobe.AfterEffects"] || | ||
| // Adobe apps automatically detected as non-compliant |
There was a problem hiding this comment.
Do we have an issue number for this?
There was a problem hiding this comment.
No, but I'll include the date in my comment to show when I removed these from the hard-coded list.
| for (CoreAction *action in actions) { | ||
| if (action.isCharacter) { | ||
| NSString *output = action.content; | ||
| CoreKeyOutput *coreKeyOutput = [kme processEvent:mEvent]; |
There was a problem hiding this comment.
I'm curious, because this function seems to ignore backspaces entirely?
There was a problem hiding this comment.
This is the old sample app which I have tried to ignore other than making sure it still builds. However, I often confuse it for Keyman IM when it comes up in search results, so I should eventually either confirm that it is actually useful or remove it from the project.
There was a problem hiding this comment.
Ah, yes, I make the same mistake too. At the very least, let's rename it!
| } | ||
|
|
||
| -(void) persistOptions:(NSDictionary*)options{ | ||
| if(options.count>0) { |
There was a problem hiding this comment.
Do we need this test? Because the loop will be a no-op anyway
| case On: | ||
| //TODO: handle this | ||
| break; | ||
| case Off: | ||
| //TODO: handle this | ||
| break; | ||
| case Unchanged: | ||
| // do nothing | ||
| break; |
There was a problem hiding this comment.
Do we have an issue to track this? If so, can you put it into the TODO comments?
| for (int i = 0; i < output.codePointsToDeleteBeforeInsert; i++) | ||
| { |
There was a problem hiding this comment.
| for (int i = 0; i < output.codePointsToDeleteBeforeInsert; i++) | |
| { | |
| for (int i = 0; i < output.codePointsToDeleteBeforeInsert; i++) { |
| } | ||
|
|
||
| - (void)testCoreProcessEvent_eventDeleteWithElNuerKmx_EmptiesContextReturnsDelete { | ||
| // TODO: enable after resolving issue getting options from Keyman Core |
There was a problem hiding this comment.
Yes, I will enable after merging to ensure that the core changes cause this test to pass.
|
|
@bharanidharanj Can you provide more detail on what the text the note contained with each step for TEST_HEBREW_ENTER_STICKIES? I don't understand how that whole line of text could have appeared after you pressed return, and I am not seeing anything similar. |
Hi @sgschantz Sorry for the confusion! When I followed the steps you mentioned in the test, I thought "Type Return" meant "Type the word Return" on the input screen. So, I typed the text "Return" and it was displayed on the screen. Now, I tried with the key and got the expected result.
|
|
@keymanapp-test-bot retest TEST_HEBREW_ENTER_STICKIES Please retest and simply press the return key as the last step |
mcdurdin
left a comment
There was a problem hiding this comment.
LGTM, one tiny tweak which is probably unlikely to ever arise but should be done anyway 😁
add guard clause Co-authored-by: Marc Durdin <marc@durdin.net>
|
Changes in this pull request will be available for download in Keyman version 17.0.230-alpha |











Instead of processing an array of action structs, get a single struct from core that encapsulates all the impacts of the most recently processed key.
Fixes #7916
Fixes #7542
Fixes #7526
Fixes #7021
Fixes #5012
Fixes #10116
User Testing
TEST_AMHARIC_STICKIES:
TEST_AMHARIC_TEXSTUDIO_9506:
TEST_YIDDISH_STICKIES:
TEST_YIDDISH_GOOGLE_DOCS_7916:
TEST_KENYA_BTL_STICKIES:
TEST_KENYA_BTL_GOOGLE_CHROME_7542:
TEST_HEBREW_ENTER_STICKIES:
TEST_POLYTONIC_GREEK_CHROME_BACKSPACE_7526:
TEST_POLYTONIC_GREEK_BACKSPACE_7021: