Skip to content
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

fails to form a complete Korean letter inside search bar #476

Closed
exploitJ opened this issue Oct 16, 2022 · 7 comments
Closed

fails to form a complete Korean letter inside search bar #476

exploitJ opened this issue Oct 16, 2022 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@exploitJ
Copy link

Issue

Every keystroke is separated when typing Korean

For example, 강 comprised with ㄱ + ㅏ + ㅇ in correct order.
One thing to notice is that unlike chinese or japanese its combined on-the-fly. (in other words there's no IME overlay menu involved)

However, search bar only takes ㄱㅏㅇ(3 separated symbol) and not 강.

Copy & pasting works, I just can't type a complete word.

@p0deje
Copy link
Owner

p0deje commented Oct 19, 2022

I don't use Korean so it's hard for me to debug, can you please provide as detailed as possible steps to reproduce the bug?

@p0deje p0deje added bug Something isn't working needs triaging Further information is requested labels Oct 19, 2022
@exploitJ
Copy link
Author

I don't use Korean so it's hard for me to debug, can you please provide as detailed as possible steps to reproduce the bug?

Korean Input Method's layout is no different to Standard English layout.
It doesn't matter if you're using English keyboard. (I'm using it too, btw.)
You may add Korean IME via System Preferences > Keyboard > Input Sources
Add "2-Set Korean" and you're good to go.

In order to input 강물, press r-k-d-a-n-f, you can try it somewhere else to see for yourself.
Now, head over to Maccy's search bar.
The text in the search bar would look like "ㄱㅏㅇㅁㅜㄹ" instead.

@p0deje
Copy link
Owner

p0deje commented Nov 7, 2022

I can reproduce the issue and know why it happens, not sure how to fix yet.

@exploitJ
Copy link
Author

exploitJ commented Nov 9, 2022

I can reproduce the issue and know why it happens, not sure how to fix yet.

Can you elaborate on why it's happening? also potential ideas on fixing if you have one.
I've started looking through your code base and tried some measures today.

Modifying processSingleCharacter inside MenuHeaderView.swift was no luck; String.precomposedStringWithCompatibilityMapping didn't fix the issue.

I'm out of ideas right now.

@p0deje
Copy link
Owner

p0deje commented Nov 9, 2022

I think the reason it's happening is because the search field loses focus after every character. This focus loss needs to happen because Maccy needs to give it to the history menu items so that the user could press Enter to select an item or arrow keys to navigate the menu.

I believe we might try to throttle this behavior so that the focus is kept for a short period of time. This would at least improve the situation for fast typing. However, I am yet to find any docs about this behavior - maybe there is a hint somewhere there.

@p0deje
Copy link
Owner

p0deje commented Nov 13, 2022

For the time being, I've pushed a small workaround that fixes this as long as the search is not fired (400 ms). There should probably be a better solution (e.g. we call some AppKit API to evaluate the string of characters and replace them) but I am yet to find it.

p0deje added a commit that referenced this issue Nov 13, 2022
Whenever we call becomeFirstResponder() on the search field, it breaks
Korean input handling where typing "rkadnf" should end up with "강물".

Ideally we'd just call some method to re-evaluate the string in the
search field and replace with proper characters, but I have not found a
way to do that yet.
@p0deje p0deje added help wanted Extra attention is needed and removed needs triaging Further information is requested labels Nov 13, 2022
@p0deje
Copy link
Owner

p0deje commented Jan 15, 2023

I didn't manage to find a reliable solution, please try using 0.25 and re-open if it's still not good enough. Hopefully, I can then make it better over time.

@p0deje p0deje closed this as completed Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants