Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

When dispatching MouseEvents to JS, should include pertinent Event details #27

Merged
merged 5 commits into from Dec 15, 2012

Conversation

jonrohan
Copy link
Contributor

When ZeroClipboard dispatches MouseEvents to JavaScript, it is only sending an argument of null rather than including any useful information. I'd love to see it pass along any pertinent Event details instead (e.g. ctrlKey, etc.), though we may need to rely on the JS dispatcher to "correct" some of the properties, e.g. pass the Client's id for the event target but have the dispatcher change that into a DOM element.

ActionScript MouseEvent details for events we currently dispatch:

JavaScript MouseEvent details:

  • Modern browsers: MouseEvent
    • Also inherits properties from Event
  • IIRC, old IE (6-8) has a different event but I can't find the docs on it at the moment

@jonrohan
Copy link
Contributor

This shouldn't be merged until #37 ships.

jonrohan added a commit that referenced this pull request Dec 15, 2012
When dispatching MouseEvents to JS, should include pertinent Event details
@jonrohan jonrohan merged commit 4c6ee9d into master Dec 15, 2012
@JamesMGreene
Copy link
Member Author

You know, thinking back to my proprietary ClipboardInjector... if we didn't capture those other mouse events (everything except CLICK) in the ActionScript, the mouse events will naturally propagate down to the HTML below anyway (as they do in my web apps). Wouldn't that be preferable to our current model of capturing the events in Flash and then dispatching incomplete versions of them back to JavaScript?

Not sure offhand if anyone is using those events in ZeroClipboard today. Alternatively, we could provide a either a loader parameter or another ExternalInterface callback to add those handlers (but default them to off), thus allowing any existing users that might utilize that functionality to still be able to use it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants