Confirmed users, Bureaucrats and Sysops emeriti
1,680
edits
Line 14: | Line 14: | ||
= Specification Change = | = Specification Change = | ||
In order to provide the plugin with information about whether or not there is a complex text composition in progress we will bump the 'NPCocoaEvent' version to '2'. If a plugin receives an 'NPCocoaEvent' with a version of '2' or higher then the key structure will contain a field of type 'NPBool' called 'compositionInProgress'. This will be set to false when no composition is in progress and true when a composition is in progress. | |||
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. | |||
2. Plugin receives 'NPCocoaEventKeyDown' event for enter key with 'compositionInProgress' set to true. | |||
3. Plugin receives 'NPCocoaEventTextInput' for completed composition. | |||
4. Plugin receives 'NPCocoaEventKeyUp' event for enter key with 'compositionInProgress' set to false. | |||
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. | |||
2. Plugin receives 'NPCocoaEventTextInput' for completed composition, the string "g". |