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

druid-shell IME api, take two #1619

Merged
merged 15 commits into from
Mar 10, 2021
Merged

druid-shell IME api, take two #1619

merged 15 commits into from
Mar 10, 2021

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Feb 23, 2021

This supersedes #1378; I'm going to use this branch to make some tweaks to the API, and eventually to integrate this into the druid textbox.

cc @lord, in case you'd like to follow along with some of this stuff.

The main change I'm envisioning currently is to have separate acquire and release methods for the locking, because druid needs some callback to know if it has to update the app data.

@cmyr cmyr force-pushed the ime-take-two branch 2 times, most recently from b91c473 to 8d9634d Compare March 5, 2021 17:17
@cmyr
Copy link
Member Author

cmyr commented Mar 6, 2021

@lord I've pushed a few more changes here that made sense in the process of doing #1636. Happy to have you take a look if you like, or else I'll self-review and do any further cleanup from there. :)

druid-shell/src/text.rs Outdated Show resolved Hide resolved
@cmyr cmyr force-pushed the ime-take-two branch 2 times, most recently from 648e403 to 846d1d8 Compare March 8, 2021 18:34
lord and others added 15 commits March 10, 2021 12:38
Adds APIs for cross-platform text input, and an initial implementation of text input
on macOS that allows for dead keys, IME input for Chinese, Japanese, etc.
On other platforms, the text input method calls are simulated from key_down events,
as a temporary measure until we can properly implement input methods on those platforms.

Also adds a new druid-shell example, `edit_text`, which is a rough, LTR and single-line
only implementation of the text input APIs to demonstrate that they work correctly.

A massive thanks to yvt's library tcw3 (https://github.com/yvt/Stella2), which was a fantastic
blueprint for the structure of this API, as well as indispensable reference when implementing
the macOS text input interfaces.
Also contains various small API renamings in response to code review comments.
This started out as me wanting to just rewrap everything to 80
columns, and then turned into a few little additional touchups.
We'll need something like this in druid, because we need to
know when we have to update the app data.
This isn't great, but it adds tab/return/delete, which feels
like the bare minimum; we can implement more as future work.
@cmyr
Copy link
Member Author

cmyr commented Mar 10, 2021

Okay I'm going to take a self-review on this, it's mostly the same code as #1378, which has already been reviewed.

@cmyr cmyr merged commit f4ae361 into master Mar 10, 2021
@cmyr cmyr deleted the ime-take-two branch March 10, 2021 18:21
@lord
Copy link
Contributor

lord commented Mar 10, 2021

Sorry, just saw this! It looks great to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants