- From: Robin Berjon <robin@w3.org>
- Date: Tue, 27 May 2014 11:39:15 +0200
- To: Ben Peters <Ben.Peters@microsoft.com>, Julie Parent <jparent@gmail.com>
- CC: Johannes Wilm <johannes@fiduswriter.com>, "public-webapps@w3.org" <public-webapps@w3.org>
On 27/05/2014 01:52 , Ben Peters wrote: >> From: Robin Berjon [mailto:robin@w3.org] On 23/05/2014 01:23 , Ben >> Peters wrote: >>>> As I said I am unsure that the way in which composition events >>>> are described in DOM 3 Events is perfect, but that's only >>>> because I haven't used them in anger and they aren't supported >>>> much. >>> >>> My thought is that we can use CommandEvent with >>> type="insertText". This would be the corollary to >>> execComamnd("insertText"), and the data would be the ñ that is >>> about to be inserted. >> >> But if you only get one event you can't render the composition as >> it is carrying out. > > I believe Composition Events are very important for IME input, but we > should fire CommandEvent with Insert text for all text input, > including IME. Are you saying we should use Composition Events even > for non-IME input? I am not using an IME, and yet I could not type in French on my keyboard without composition. Obviously, if I switch to Kotoeri input, I'll get composition *and* an IME popup. But for regular French input (in a US keyboard) I need: é -> Alt-E, E è -> Alt-`, E à -> Alt-`, A ô -> Alt-I, O ü -> Alt-U, U ñ -> Alt-˜, N (for the occasional Spanish) (and a bunch more) Some older apps (you pretty much can't find them anymore) used to not display the composition as it was ongoing and only show the text after composition had terminated. That was survivable but annoying, and it only worked because composition in Latin-script languages is pretty trivial (except perhaps for all you Livonian speakers out there!), but I don't think it would be viable for more complex compositions. And even in simple cases it would confuse users to be typing characters with no rendering feedback. Without composition events you can't render the ongoing composition. See what's going on at: https://gist.github.com/darobin/8a128f05106d0e02717b#file-twitter-html-L81 That is basically inserting text in a range that's decorated to be underlined to show composition in progress. Composition updates *replace* the text in the range. And at the end the range is removed and text is inserted. The above is for Mac, but I have distant memories of using something similar on Windows called the "US International Keyboard" where you could have apostrophes compose as accents, etc.. I don't recall how it was rendered though. -- Robin Berjon - http://berjon.com/ - @robinberjon
Received on Tuesday, 27 May 2014 09:39:31 UTC