NPAPI:AdvancedKeyHandling: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 2: Line 2:


Accepted, ready for implementation. Assigned NPAPI version 25.
Accepted, ready for implementation. Assigned NPAPI version 25.
= Contributors =
* Last modified: March 20, 2009
* Author: Josh Aas, Mozilla Corporation
* Contributors: Johnny Stenback (Mozilla), Aaron Leventhal (IBM), Oliver Yeoh (Sun), Danielle Pham (Sun), Deneb Meketa (Adobe), Anders Carlsson (Apple), Michelle Sintov (Adobe), Karl Tomlinson (Mozilla)


= Problem Summary =
= Problem Summary =
Line 7: Line 13:
# Plugins eat all key events when focused, Gecko does not get a chance to process anything. This is [https://bugzilla.mozilla.org/show_bug.cgi?id=78414 Mozilla bug 78414].
# Plugins eat all key events when focused, Gecko does not get a chance to process anything. This is [https://bugzilla.mozilla.org/show_bug.cgi?id=78414 Mozilla bug 78414].
# There is no way to get focus from a plugin using the keyboard. This is [https://bugzilla.mozilla.org/show_bug.cgi?id=93149 Mozilla bug 93149].
# There is no way to get focus from a plugin using the keyboard. This is [https://bugzilla.mozilla.org/show_bug.cgi?id=93149 Mozilla bug 93149].
= Existing Discussions and Documentation =
<tt>Note: Some of the archive links here require authentication, however most relevant information behind those links has been copied to this document.</tt>
Mozilla bugs [https://bugzilla.mozilla.org/show_bug.cgi?id=78414 78414] and [https://bugzilla.mozilla.org/show_bug.cgi?id=93149 93149] have some information but are generally cluttered with useless comments. Deneb Meketa from Adobe posted a proposal on [https://bugzilla.mozilla.org/show_bug.cgi?id=93149 bug 93149], comments [https://bugzilla.mozilla.org/show_bug.cgi?id=93149#c34 #34] and [https://bugzilla.mozilla.org/show_bug.cgi?id=93149#c36 #36] discuss it.
There was a [https://mail.mozilla.org/private/plugin-futures/2004-March/000057.html plugin-futures discussion started by Johnny Stenback in March of 2004] on the topic of handled status for key events. Johnny's discussion resulted in a [https://intranet.mozilla.org/PluginFutures/index.php/PluginEvents plugin-futures wiki entry].
Aaron Leventhal of IBM started a [https://mail.mozilla.org/private/plugin-futures/2004-April/000064.html relevant discussion on plugin-futures in April of 2004]. The proposal discussed is an extension of Johnny's from March of 2004 and is actually fairly detailed.
API modification work is discussed in [https://bugzilla.mozilla.org/show_bug.cgi?id=348279 Mozilla bug 348279]. The discussion there generally revolves around a proposal from Sun. Sun posted to plugin-futures about this work in March of 2007.
Karl Tomlinson [http://groups.google.com/group/mozilla.dev.tech.plugins/browse_thread/thread/7b21b6b08499941d/5458da943ed1a81b#5458da943ed1a81b wrote a message on Google Groups proposing an X11 windowless plugin API]. There is some related info in that message.
Josh Aas wrote a [http://boomswaggerboom.wordpress.com/2008/09/11/npapi-plugin-bugs-accessibility/ blog post] on the issue in September of 2008.


= API Requirements =
= API Requirements =
Line 30: Line 20:
* Plugins should be able to hand events to the browser when they want to, regardless of the source. This would allow the browser to handle events the plugin does not want to handle.
* Plugins should be able to hand events to the browser when they want to, regardless of the source. This would allow the browser to handle events the plugin does not want to handle.


= Accepted Proposal =
= Negotiating Advanced Key Handling =
 
== Negotiating Advanced Key Handling ==


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.
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.
Line 39: Line 27:
* NPNVsupportsAdvancedKeyHandling (NPNVariable = x)
* NPNVsupportsAdvancedKeyHandling (NPNVariable = x)


== Specification ==
= Specification =
 
'''NPAPI Advanced Key Handling (AKH) Support'''
 
* Last modified: March 20, 2009
* Author: Josh Aas, Mozilla Corporation
* Contributors: Johnny Stenback (Mozilla), Aaron Leventhal (IBM), Oliver Yeoh (Sun), Danielle Pham (Sun), Deneb Meketa (Adobe), Anders Carlsson (Apple), Michelle Sintov (Adobe), Karl Tomlinson (Mozilla)


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 99: Line 81:
* GTK (non-xembed windowless): <tt>FocusIn</tt> and <tt>FocusOut</tt> will not be sent.
* GTK (non-xembed windowless): <tt>FocusIn</tt> and <tt>FocusOut</tt> will not be sent.


== Comments ==
= Comments =


* Situations to consider:
* Situations to consider:
** Plugin is the only object in the tab chain for the window, last element inside plugin is focused and user hits tab.
** Plugin is the only object in the tab chain for the window, last element inside plugin is focused and user hits tab.
*** Plugin should call <tt>NPN_GiveUpFocus</tt> in response to the tab event, browser should return <tt>true</tt> and then call <tt>NPP_GotFocus</tt> with <tt>NPFocusNext</tt> for the direction argument to return focus to the first element in the plugin. If the browser does not want focus to wrap around then it can return <tt>false</tt> for the <tt>NPN_GiveUpFocus</tt> call. Plugin does not pass the tab event to the browser either way.
*** Plugin should call <tt>NPN_GiveUpFocus</tt> in response to the tab event, browser should return <tt>true</tt> and then call <tt>NPP_GotFocus</tt> with <tt>NPFocusNext</tt> for the direction argument to return focus to the first element in the plugin. If the browser does not want focus to wrap around then it can return <tt>false</tt> for the <tt>NPN_GiveUpFocus</tt> call. Plugin does not pass the tab event to the browser either way.
= Existing Discussions and Documentation =
<tt>Note: Some of the archive links here require authentication, however most relevant information behind those links has been copied to this document.</tt>
Mozilla bugs [https://bugzilla.mozilla.org/show_bug.cgi?id=78414 78414] and [https://bugzilla.mozilla.org/show_bug.cgi?id=93149 93149] have some information but are generally cluttered with useless comments. Deneb Meketa from Adobe posted a proposal on [https://bugzilla.mozilla.org/show_bug.cgi?id=93149 bug 93149], comments [https://bugzilla.mozilla.org/show_bug.cgi?id=93149#c34 #34] and [https://bugzilla.mozilla.org/show_bug.cgi?id=93149#c36 #36] discuss it.
There was a [https://mail.mozilla.org/private/plugin-futures/2004-March/000057.html plugin-futures discussion started by Johnny Stenback in March of 2004] on the topic of handled status for key events. Johnny's discussion resulted in a [https://intranet.mozilla.org/PluginFutures/index.php/PluginEvents plugin-futures wiki entry].
Aaron Leventhal of IBM started a [https://mail.mozilla.org/private/plugin-futures/2004-April/000064.html relevant discussion on plugin-futures in April of 2004]. The proposal discussed is an extension of Johnny's from March of 2004 and is actually fairly detailed.
API modification work is discussed in [https://bugzilla.mozilla.org/show_bug.cgi?id=348279 Mozilla bug 348279]. The discussion there generally revolves around a proposal from Sun. Sun posted to plugin-futures about this work in March of 2007.
Karl Tomlinson [http://groups.google.com/group/mozilla.dev.tech.plugins/browse_thread/thread/7b21b6b08499941d/5458da943ed1a81b#5458da943ed1a81b wrote a message on Google Groups proposing an X11 windowless plugin API]. There is some related info in that message.
Josh Aas wrote a [http://boomswaggerboom.wordpress.com/2008/09/11/npapi-plugin-bugs-accessibility/ blog post] on the issue in September of 2008.


= Past Specification Attempts =
= Past Specification Attempts =


[[https://wiki.mozilla.org/NPAPI:AdvancedKeyHandlingHistory|Click here]] to see information on past specification attempts.
[[https://wiki.mozilla.org/NPAPI:AdvancedKeyHandlingHistory|Click here]] to see information on past specification attempts.
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits

Navigation menu