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

Merged
merged 5 commits into from Dec 15, 2012

2 participants

@JamesMGreene
ZeroClipboard member

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
ZeroClipboard member

This shouldn't be merged until #37 ships.

@jonrohan jonrohan merged commit 4c6ee9d into master Dec 15, 2012

1 check passed

Details default The Travis build passed
@JamesMGreene
ZeroClipboard member

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 join this conversation on GitHub. Already have an account? Sign in to comment