Confirmed users, Bureaucrats and Sysops emeriti
1,680
edits
Line 388: | Line 388: | ||
=== Specification === | === Specification === | ||
'''Advanced Key Handling Support''' | '''NPAPI Advanced Key Handling (AKH) Support''' | ||
* Last modified: February 25, 2009 | * Last modified: February 25, 2009 | ||
Line 396: | Line 396: | ||
Under this proposal, existing behavior does not change. In order for behavior to change, the browser must return a boolean value of "true" for "NPNVSupportsAdvancedKeyHandling" *and* the plugin must return a boolean value of "true" for "NPPVSupportsAdvancedKeyHandling". There is no active negotiation of modes and supported status cannot change at any time for either the browser or the plugin. | Under this proposal, existing behavior does not change. In order for behavior to change, the browser must return a boolean value of "true" for "NPNVSupportsAdvancedKeyHandling" *and* the plugin must return a boolean value of "true" for "NPPVSupportsAdvancedKeyHandling". There is no active negotiation of modes and supported status cannot change at any time for either the browser or the plugin. | ||
The rest of this specification describes behavior specific to | The rest of this specification describes behavior specific to AKH mode. | ||
For windowed plugins, events that the browser should attempt to handle can be forwarded to the browser via a new function. | For windowed plugins, events that the browser should attempt to handle can be forwarded to the browser via a new function. | ||
Line 429: | Line 429: | ||
// Called by the browser when the browser intends to take focus. | // Called by the browser when the browser intends to take focus. | ||
// Instance argument indicates the instances losing focus. | // Instance argument indicates the instances losing focus. | ||
// Direction argument indicates | // Direction argument indicates the direction of the element receiving focus. | ||
// There is no return value, plugins will lose focus when this is called. | // There is no return value, plugins will lose focus when this is called. | ||
NPBool NPP_LostFocus(NPP instance, NPFocusDirection direction); | NPBool NPP_LostFocus(NPP instance, NPFocusDirection direction); | ||
Line 439: | Line 439: | ||
NPBool NPP_GotFocus(NPP instance, NPFocusDirection direction); | NPBool NPP_GotFocus(NPP instance, NPFocusDirection direction); | ||
</pre> | </pre> | ||
When a plugin takes focus, it will receive an <tt>NPP_GotFocus</tt> call before receiving the event that gave it focus (such as a mouse click). | |||
If a plugin receives an event that causes it to attempt to give up focus, the plugin should simply call NPN_GiveUpFocus and not pass on the event since attempting to give up focus is essentially handling the event. | |||
Focus events will not be passed to plugins via <tt>NPP_HandleEvent<tt> when AKH is enabled. Per platform, this means: | |||
* Mac OS X (windowless): <tt>NPEventType_GetFocusEvent</tt> and <tt>NPEventType_LoseFocusEvent</tt> will not be sent. | |||
* Windows (windowless): <tt>WM_SETFOCUS</tt> and <tt>WM_KILLFOCUS</tt> will not be sent. | |||
* Windows (windowed): coming soon | |||
* GTK (non-xembed windowless): coming soon | |||
* GTK (non-xembed windowed): coming soon | |||
* GTK (xembed): coming soon | |||
=== Comments === | === Comments === |