-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
feat(mac): both option keys generate right alt if no left alt mapping #12458
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, aside from concerns on memory management. Good work
@@ -67,6 +64,38 @@ -(void)changeKeyboardWithKmxFilePath:(NSString*) path { | |||
} | |||
} | |||
|
|||
-(CoreKeyboardInfo*) getKeyboardInfoForKmxFile:(NSString*)kmxFile { | |||
NSArray *keyArray = [self getKeyArray]; | |||
CoreKeyboardInfo* info = [[CoreKeyboardInfo alloc] init:kmxFile keyArray: keyArray]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is keyArray and its members leaked here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, by default there is a strong reference to the key array in CoreKeyboardInfo which is dealloced when the keyboard is changed
NSMutableArray *keyArray = [[NSMutableArray alloc] initWithCapacity:0]; | ||
km_core_keyboard_key *keyList; | ||
|
||
km_core_status result = km_core_keyboard_get_key_list(self.coreKeyboard, &keyList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is keyList leaked here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, adding a call to km_core_keyboard_key_list_dispose
Test ResultsI tested this issue with the attached "Keyman 18.0.118-alpha-local" build on the macOS Sonoma 14.5 version. here, I am sharing my observation.
It works well. Thank you. |
memory leak of key list without disposing
Changes in this pull request will be available for download in Keyman version 18.0.122-alpha |
When a keyman keyboard does not define any rules for the Left Alt key, then both the left and right option keys on the Mac keyboard should result in a Right Alt key combination being generated.
Fixes: #875
Fixes: #933
User Testing