-
-
Notifications
You must be signed in to change notification settings - Fork 111
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(mac): Java does not appear to be 100% compatible with InputMethodKit #3935
Comments
Relates to #3935. This switches Java apps into legacy mode. However, Java itself will need patching to support Keyman, as it makes assumptions about input methods, including matching specific input methods by name, before enabling its complex text support. I am in process of submitting a bug report and may try and submit a patch (although the process seems a little convoluted). It requires a change to a single file, AWTView.m, with the following diff (against JDK 16.0): diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m index 3e80b5a6cf3..2ae1f4f3f12 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m @@ -263,6 +263,16 @@ - (void) keyDown: (NSEvent *)event { fProcessingKeystroke = YES; fKeyEventsNeeded = YES; + if([(NSString *)kbdLayout containsString:@"keyman"]) { + // Keyman handles all key events; none should be + // passed through as default before Keyman processes them + fKeyEventsNeeded = NO; + } // Allow TSM to look at the event and potentially send back NSTextInputClient messages. [self interpretKeyEvents:[NSArray arrayWithObject:event]]; @@ -960,7 +989,9 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange if ((utf16Length > 2) || ((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:codePoint]) || - ((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"]))) { + ((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"])) || + ([(NSString *)kbdLayout containsString:@"keyman"]) + ) { aStringIsComplex = YES; }
See http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8257650 for our submitted bug. |
Have there been any developments with this issue? I just posted on the ELAN forum before seeing this. https://archive.mpi.nl/forums/t/trouble-with-input-from-syllabic-orthography-keyboard/3468 |
We have not had any progress with this; it is a limitation in Java and we submitted an issue 4 years ago for it (https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8195675). Feel free to submit another bug to Oracle! |
Ok, I'm not sure I know enough to submit a bug with all the technical info they need but I would live to tell them this potentially affects a large number of minority languages. |
It's difficult -- I hope that bug reports from various people would help them to understand the scope. In theory we could submit a patch, but the amount of legwork that is required to do that seems daunting! (This seems to be a problem with quite a few large open source projects -- they develop policies and procedures which work for them but effectively lock out external contributors who already have to navigate huge technical complexity in order to submit patches, and the additional policy complexity just makes it too hard.) |
Hi @mcdurdin, I have a similar issue running the IPA(SIL) Keyboard on Mac. They keyboard works well everywhere, except for ELAN. Any recommendation where I should look for a solution? |
@JuarezRC, yes, this is a long-standing issue. We are waiting for Java developers to fix things on their end -- Keyman is behaving correctly; Java (which ELAN is built on) is not. The two bug reports above have had no response from Oracle or any Java Development Kit developers; we may need to try and raise them in forums or Java dev mailing lists. We have not had the in-team capacity to chase these up until now. Can I encourage you to also open a bug report or ask on the Java Discussion group (looks like awkward timing though as they are migrating their Discussion databases in the next couple of days -- may want to wait a week).
Other possible workarounds, even if not palatable -- mentioned for completeness:
We will also have another go at contributing a patch to JDK when we find the capacity (@sgschantz this may be something you could look into?) |
Thanks! I will follow up on this. |
@srl295 please review |
See #3944 for sample patch |
Some positive progress on this with openjdk, follow links above |
See also https://community.software.sil.org/t/keyman-and-xlingpaper/8580/1 (presumably XMLMind which XLingPaper is based on) |
Yes, the XMLmind XL Editor (aka XXE) is written in Java and XLingPaper is a set of configuration files for it. The challenge we'll face is that most XLingPaper users are using an older version of XXE which still had a personal use license. The version they're using will not have the fix to the openjdk. Sigh. |
I've finally created a backport for v21 https://bugs.openjdk.org/browse/JDK-8342073 - I have a lot of questions about the process (it's literally been many years since I have done a backport for them) but it's in progress. If this goes well I'll replicate it back as far as I can. |
Requested backports for:
|
Update^ All four of these have been tested on mac and found to fix the issue. |
Good news! |
Yes that’s what it means.
Would you like me to try to get a jdk 17 package to you to test ?
El El sáb, oct 26, 2024 a la(s) 11:36 a.m., Andy Black <
***@***.***> escribió:
… Good news!
I'm not familiar with backports and how they work. I'm currently using
Azul Zulu's JDK 17 (17.0.11+9; its Bundle name is Zulu 17.50.19). Does this
mean that at some point Azul will include this fix for their Java 17 JDK
and at that time I can get that version and then Keyman will work with my
Java apps built using this?
—
Reply to this email directly, view it on GitHub
<#3935 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGQZM4N63J77HHF6LHSVBTZ5PAKRAVCNFSM4UADTGZKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENBTHE3DINRRGU3A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ok 21 was merged! Others to follow. |
Yes, a jdk 17 package to test would be helpful. Since I wrote earlier, I've learned how to use jpackage to create installers. If it's not too much trouble, a version 8 jre would also be nice to test (this would be for the XLingPaper configuration files that are for the XMLmind XML Editor I mentioned. here back in April. I could try swapping out the jre we're currently using with the new one and see if it runs as before, but also allows for Keyman keyboards. |
@AndyBlack I sent you a gchat and also a share link to a directory w/ zips for 17 and 8. I used "make images" to build it. Let me know if it works or not. |
@srl295 Thanks! It may be a day or two before I can test these. |
17 integrated |
This is a container issue for compatibility issues with Java on macOS.
The following may be related: https://youtrack.jetbrains.com/issue/JBR-1758
Related issues:
The text was updated successfully, but these errors were encountered: