Since you're only concerned about trusted event you may want to use the 4th argument of addEventListener instead of checking that yourself.
https://developer.mozilla.org/en/docs/DOM/element.addEventListener 

This is non standard though while using directly isTrusted is standard as far as I know.