Comment 231 for bug 263435

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

(In reply to comment #229)
> > If I am playing a Flash game, and I hit space to make the Yeti swing the bat
> > at the penguin, I want the darn plugin to get the space. I don't want
> > Firefox to scroll the page down
>
> Well, my suggestion would solve this in the sense that Spacebar would be sent
> to the Flash in the same way that it is sent to a textbox or checkbox or any
> other element that has focus.

Well, Space, tab, etc. would iirc get sent to the textbox and when they don't handle them, they bubble up... generally. That does seem like the right way to handle it for Flash (send to it first, if unhandled, bubble up.) That's not what I read you as saying.

Backspace being a great example: normally, it takes you to the previous page (back), but in a text box it deletes a key. Script can also trap backspace (just like ActionScript might in Flash) and prevent both of those things from occurring.

> I'm not sure what you're trying to say about Ctrl+F. Are you saying that pages
> like bk.com should have Ctrl+F sent to the Flash applet, while other pages
> (e.g. YouTube) shouldn't?

No. If I click inside YouTube, and press Ctrl-F, the following should happen:

1. Flash gets the key event. It comes from the operating system and Firefox doesn't even know about it yet.

2. Most likely, Flash checks the key against an internal (*short*) blacklist of keys not to be sent to script. Ideally, it might query Firefox/Safari/whatever for this list.

3. Flash checks for an ActionScript onKeyUp handler. If one exists, the key press is handled (YouTube would not have one of these.) Ideally there would be a way for ActionScript to communicate that the event was/wasn't handled.

4. If the key wasn't handled, or step 3 was skipped, the key is sent on to Firefox for it to handle.

Another plugin (like Adobe Reader) would work similarly.

> I think the differentiation is going to be very
> difficult to make, so we should probably not try. If the Find toolbar pops up
> but is useless, this is much less severe than having something like Ctrl+T not
> work at all.

Well, Ctrl-T shouldn't be handled by plugins, I think we can all agree on that. But it is difficult to make a list of such keys that really makes sense for all use cases. Handling it like Windows applications are already handled, in a way programmers will understand, seems like the best solution IMHO.

> If the Flash applet doesn't respond to it either (and 99% of them
> don't) the user tends to think that Firefox has locked up.

Exactly; if Flash doesn't respond to it, obviously Firefox should. But the order of precedence is that; when it is *focused*, not only does Flash get the keystroke (nothing we can do about that), but it's also the thing the user is probably most interested in.

(In reply to comment #230)
This is how things always work in programming. You're describing the current situation with one small alteration: currently, plugins cannot send the key events to Firefox if they don't consume them. That's really all that needs to change.

-[Unknown]