>Needing to determine the difference is a corner case, but it's an issue >I've >run into from time-to-time. For example, I've got a plug-in where I've got >a >click event set to toggle the current visibility of an element. However, if >I call that event programmatically I always want to make sure that it >"shows" the element (and doesn't toggle the state.) > >As I said, it's a corner case but one I've run into a few times in the past >6 months.
It looks like maybe this is a better method: function isJQueryEvent(e){ return !(($.browser.msie ? "cancelBubble" : "bubbles") in e); } The ctrlKey is only available when a keyboard event occurs. I needed something that works for the click event too. There may be some issues with this, so it would be nice if a jQuery event object had: "e.jquery = true". That would make my code fullproof. -Dan