Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Improve IME support - #852

Merged
zcbenz merged 9 commits into
masterfrom
ime-support
Sep 18, 2013
Merged

zcbenz merged 9 commits into
masterfrom
ime-support

Conversation

@zcbenz

@zcbenz zcbenz commented Sep 17, 2013

Copy link
Copy Markdown
Contributor

This is required to make IME's input bubble follow the cursor.
The composition text should only show on screen temporarily and gets
disappered when input is cancelled or done. We simply mark the
composition as selected, so it can not only indicate this is composition
text instead of normal text, but also updates the composition without
adding new interfaces.
Some IME's input bubble would have strange behavior when they thought
the target input box is small.
On OS X, press and hold `c` could show an accent menu to replace `c` with
accented ones like `ć`, there is no corresponding events in W3C, so we
detected it by checking whether the text in input box are selected (this
is how Chrome implemented this feature).

And also note that IME inputs were handled the same way in Chrome, the
compostion text would be marked as selected and got replaced with final
inputs. However the compostion text won't trigger textInput event, so
it's distinguished by checking whether the hiddenInput's value are
changed by Chrome.

Fixes electron/electron#50.
@probablycorey

Copy link
Copy Markdown

Nice!

On Mon, Sep 16, 2013 at 9:34 PM, Cheng Zhao [email protected]:


You can merge this Pull Request by running

git pull https://github.com/atom/atom ime-support

Or view, comment on, or merge it at:

#852
Commit Summary

  • Move hidden input to the same position with cursor view.
  • Show IME's composition text on screen.
  • Make hiddentInput bigger when inputing with IME.
  • Select the text while inserting.
  • Skip the undo stack when changing composition text.
  • Restore previous selected text after IME composition is done.
  • Add spec for syncing cursorView and hiddenInput's position.
  • Work around of the accented character suggestion feature in OS X.
  • Make accented character suggestion work for multiple cursors.

File Changes

  • M spec/editor-spec.coffeehttps://github.com/Improve IME support #852/files#diff-0(4)
  • M src/editor.coffeehttps://github.com/Improve IME support #852/files#diff-1(32)
  • M src/selection.coffeehttps://github.com/Improve IME support #852/files#diff-2(4)

Patch Links:

@probablycorey

Copy link
Copy Markdown

Did you notice if this impacts typing performance at all?

@zcbenz

zcbenz commented Sep 17, 2013

Copy link
Copy Markdown
Contributor Author

Hmm, I didn't notice any performance regression.

zcbenz added a commit that referenced this pull request Sep 18, 2013
@zcbenz
zcbenz merged commit e509e23 into master Sep 18, 2013
@zcbenz
zcbenz deleted the ime-support branch September 18, 2013 06:09
@kevinsawicki kevinsawicki mentioned this pull request Sep 25, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants