I've tested your code, all worked well except for right double click, which is treat as the same as left double click, which is kind of annoying to me. 
I'd suggest that don't handle right double click.