How to detect if a click() is a mouse click or triggered by some code?
Wait for some time and use event.isTrusted - its supported by IE9, Opera 12, and Firefox Nightly. Webkit will support it too, most probably.
event.isTrusted
Currently, there is no guaranteed way to know.