NPAPI:CocoaCompositionClarification: Difference between revisions

Line 19: Line 19:
When 'compositionInProgress' there is not necessarily an input method window open. For example, consider the last key press for a composition which is typically the "enter" key. The sequence of events resulting from that physical key press might be:
When 'compositionInProgress' there is not necessarily an input method window open. For example, consider the last key press for a composition which is typically the "enter" key. The sequence of events resulting from that physical key press might be:


1. Input method window closes.
<ol>
2. Plugin receives 'NPCocoaEventKeyDown' event for enter key with 'compositionInProgress' set to true.
<li> Input method window closes.</li>
3. Plugin receives 'NPCocoaEventTextInput' for completed composition.
<li> Plugin receives 'NPCocoaEventKeyDown' event for enter key with 'compositionInProgress' set to true.</li>
4. Plugin receives 'NPCocoaEventKeyUp' event for enter key with 'compositionInProgress' set to false.
<li> Plugin receives 'NPCocoaEventTextInput' for completed composition.</li>
<li> Plugin receives 'NPCocoaEventKeyUp' event for enter key with 'compositionInProgress' set to false.</li>
</ol>


Another situation might be one in which returning "kNPEventStartIME" for a 'NPCocoaEventKeyDown' event does not open an input method window. In this case the sequence of events would look like:
Another situation might be one in which returning "kNPEventStartIME" for a 'NPCocoaEventKeyDown' event does not open an input method window. In this case the sequence of events would look like:


1. Plugin receives 'NPCocoaEventKeyDown' event for 'g' key with 'compositionInProgress' set to true.
<ol>
2. Plugin receives 'NPCocoaEventTextInput' for completed composition, the string "g".
<li> Plugin receives 'NPCocoaEventKeyDown' event for 'g' key with 'compositionInProgress' set to true.</li>
<li> Plugin receives 'NPCocoaEventTextInput' for completed composition, the string "g".</li>
</ol>
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits