Comment 185 for bug 263435

Revision history for this message
In , Unknown-simplemachines (unknown-simplemachines) wrote :

A few things to note:

1. Some work on this has already been done in bug 348279. I think that just needs to be continued.

2. Currently, most plugins are "windows". This means the gui toolkit (e.g. Windows, Gnome, KDE) in most cases (e.g. not on Macs) already gives them key events when they have focus (this has nothing to do with magical "short cut keys" - key events are key events are key events for everything on your keyboard.)

3. Making Firefox somehow capture all key events would render most plugins useless or inaccessible, because they would be unable to act upon any keypresses (even typing letters, up/down, etc. etc. etc.)

4. What needs to happen is that plugins need a way to (or just need to be written so that they do) hand the key events to the browser (there is no "back", this is the first time the browser would see them), so that the browser can process them. See attachment 257819 for more detail.

5. It does not logically make sense for the plugin to take an action on a keypress, and the browser ALSO to take action on it. For example:

   A. If I press "page up" on my keyboard while a PDF has focus, I do *not* want Firefox to scroll the page up, and I definitely don't want the PDF to scroll up *and* Firefox to scroll the containing page up. Page up *is* a short cut key as much as any other.

   B. If I press Ctrl-P (print), it is extremely unlikely I wish Firefox to print the current subset of the PDF I am viewing, but rather that I want to print the entire PDF. Only the plugin should handle Ctrl-P. This is certainly, by any definition, a short cut key as much as Ctrl-T is.

Again, there is no forwarding of keypress events *from* the browser *to* a plugin. Don't think of it that way, that's not how the gui toolkits work (in most cases.) The plugin already owns the keypresses. If you cannot trust the plugin you should by no means and in no case have the plugin installed.

Obviously, Flash (as an example) should have things in place *within their plugin* which would make sure that Ctrl-T could not be trapped (if they decide to do that), or similar. Flash *content*, such as annoying advertisements, should not be able to handle "system-like" key press events.

But, that is hardly controllable by Firefox (it's really up to the plugins whether they forward their keypress events to Firefox or not.) This is something plugin authors (I do not mean authors of Flash swfs, I mean authors of *NSplugins* and if you're reading this bug you better know the difference) have to deal with.

-[Unknown]